+ Start a Discussion
Ravindar AdminRavindar Admin 

Javascript code in custom link

Hi, I am using Javascript code in Custom link to open a link or display Error message based on the condition .
Behavior= Execute Javascript
Content Source= Onclik javascript
if('{object__c.field1__c}' <> 'Z0' || '{object__c.field1__c}' <> 'Z4')
window.alert("Error Message");

But, It is not working. Can anyone give suggestion

Raj VakatiRaj Vakati
Use this code

if('{!object__c.field1__c}' !== 'Z0' && '{!object__c.field1__c}' !== 'Z4') {
  alert('Error Message');
else {