[SalesForce] Custom Button with Conditional URL Syntax

After looking at the documentation here for custom buttons using conditional logic, I'm still getting a syntax error for button. I believe it has something to do with attempting to append the URL with the ID. Because the content source is URL, not execute JS, it's not appropriate to use JSENCODE here right?

https://{!IF(NOT(ISNULL(Opportunity.RECAP_ID__c)),
"recap.retailcapital.com/backend/account_report.php?id="&
{!Opportunity.RECAP_ID__c},"recap.retailcapital.com")}

Best Answer

You can try with following code, there is no need to enclose Opportunity.RECAP_ID__c inside {!}

https://{!IF(NOT(ISNULL(Opportunity.RECAP_ID__c)),

"recap.retailcapital.com/backend/account_report.php?id="&
Opportunity.RECAP_ID__c,"recap.retailcapital.com")}
Related Topic