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
karthik Jonnalagaddakarthik Jonnalagadda 

Custom Button Script Error

if('{! User.Profile }'=='Excutive'){
alert("No Access");



I have tried to find the issue, Got that issue.
Looks like code is correct, issue is for window.parent.location.href value, URL parameters should no have new lines. you must need to write URL in single like.

If you copy and paste your code to notepad++, you will find that the Id, QueryId and Template Id parameters are in newline like below.

User-added image

Please remove that new line character, paste that code in notepad++  and just do backspace before &Id=....

Thanks & Cheers,
Jigar (