function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
34213421 

Unexpected Token Error message on Custom Button

Hi,

I am trying to add additional logic to an existing button on a Custom Object and I get the error saying Unexpected Token. Here is the code, I am trying to add. Here OrderApi__Receipt__c.OrderApi__Balance__c is the Formula field of type Currency. I did try adding $ before 0, but it still gave the same error.

else if({!OrderApi__Receipt__c.OrderApi__Is_Refund__c}&&{!OrderApi__Receipt__c.OrderApi__Balance__c} =0.00){ 
alert('Refund processed. DO you wish to continue'); 
}else if({!OrderApi__Receipt__c.OrderApi__Is_Refund__c}) { 
//alert('in refund loop'); 

Thoughts??
Naveen Rahul 26Naveen Rahul 26
Hello HK,

Try use like below.
 
var order_refund='{!OrderApi__Receipt__c.OrderApi__Is_Refund__c}';
var order_balance='{!OrderApi__Receipt__c.OrderApi__Balance__c}';

else if(order_refund && order_balance ='0.00'){ 
alert('Refund processed. DO you wish to continue'); 
}else if(order_refund) { 
//alert('in refund loop');
Thanks
D Naveen Rahul.