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'){
window.parent.location.href="https://composer.congamerge.com?SessionId={!API.Session_ID}
&ServerUrl={!$Api.Partner_Server_URL_290}
&Id={!Ibanking_Project__c.Id}&QueryId=[Q1]a0Tg0000002eOMq,[Q2]a0Tg0000002eORQ&TemplateId=a0Ug0000002el92";
}else{
alert("No Access");
}


 
Jigar.LakhaniJigar.Lakhani

Hello,

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 (pateljb90@gmail.com)