Skip to main content
I have a custom button that I would like to validate against the Status field. 

If Status does not equal "Approved by Business Manager" return an error message. 

I have tried the following but does not work:

IF({!ISPICKVAL( Invoice__c.Status__c , "Approved by Business Manager")},

/apex/loop__looplus?sessionId={!$Api.Session_ID}&eid={!Invoice__c.Id}

&ddpids=a0Z50000009UjxA&deploy=a0Y500000091MwT

&contactid=0035000002ZrYHU,

Alert('Value can only be Approved by Business Manager'))

5 answers
  1. Jan 26, 2016, 10:02 PM
    If you have your custom button setup to execute JavaScript you can try this:

     

    if(!{!ISPICKVAL(Invoice__c.Status__c, "Approved by Business Manager")}){

    alert('Value can only be Approved by Business Manager');

    }else{

    window.open("/apex/VF_Example?sessionId"+{!$Api.Session_ID}+"&eid="+{!Invoice__c.Id}+"&ddpids=a0Z50000009UjxA&deploy=a0Y500000091MwT

    &contactid=0035000002ZrYHU", "_blank");

    }

     
0/9000