Activity Forums Salesforce® Discussions Disable Custom Button on Standard Page

  • Utsav

    Member
    April 29, 2016 at 1:10 pm

    Hi Prakhar,

    This can be achieved by creating javascript button on the object and as per the condition specified, by using CSS to disable the button on Page Layout. Below is the code to achieve the same:-

    {!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
    {!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}

    if({!ISNUMBER(Employee__c.Salary__c)}){

    this.disabled = false;
    this.classname = 'btnDisabled';

    }
    else{

    var btnService = document.getElementsByName("test");
    btnService[0].value='Please wait...'; //Change the text
    btnService[0].disabled=true;

    }

    Hope that helps for you.

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos