Activity Forums Salesforce® Discussions What is the use of Onclick attribute in Salesforce?

  • What is the use of Onclick attribute in Salesforce?

    Posted by MOHIT on March 5, 2020 at 3:13 PM

    What is the use of Onclick attribute in Salesforce?

    Deepak replied 6 years ago 2 Members · 1 Reply
  • 1 Reply
  • Deepak

    Member
    March 5, 2020 at 4:09 PM

    Hi,

    <apex:commandbutton action="{!delete}" value="Delete" immediate="true" onclick="dislayErr()"/>

    function displayErr(){
    if({!Account.name != 'Test User'}){
    alert("You are not allowed to delete this credit card entry");
    }
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos