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
Charni WigginsCharni Wiggins 

Syntax error for simple custom button with link

Hi all,

I can't figure out why I have a syntax error for the following custom button, I just want it to have a link if the users profile name contains the word "Manager", and if not then have no link. (if there is another way to restrict buttons via a profile please let me know)

Button:

{!IF( CONTAINS({!$Profile.Name}, "Manager" ) , /apex/echosign_dev1__AgreementTemplateProcess?masterId={!Contact.Id}&templateID=a8r0Y000000XadDQAS, 0)}


{!$Profile.Name}, is what is highlighted when I click Check Syntax. 

Thank you in advance! 
Narender Singh(Nads)Narender Singh(Nads)
Hey Charni,
Try this

{!IF( CONTAINS($Profile.Name, "Manager" ) , '/apex/echosign_dev1__AgreementTemplateProcess?masterId=Contact.Id&templateID=a8r0Y000000XadDQAS', '0')}

Let me know if it helps.
Thanks.
Alain CabonAlain Cabon
Hi,

Don't repeat   {!  in the same formula.

{! IF( CONTAINS($Profile.Name, "Manager" ) ,
"/apex/echosign_dev1__AgreementTemplateProcess?masterId=" + Contact.Id + " &templateID=a8r0Y000000XadDQAS", 0) }