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
Nicholas MiramsNicholas Mirams 

Java botton to do validation then open a URL with pre populated fields

Hi,

Gettgin an error 'Invalid or Unexpecte Token'

I am tryign to create a button in salesforce to check if the Opportuntiy Stage is a certain stage and if so open a url, pre populating fields along the way: -

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/28.0/apex.js")} 


if("{!Opportunity.StageName}" != "Won - Pending Ops") { 

alert("You cannot create a Sales Handover until the opportunity is in the Stage of 'Won - Pending Ops'.\n\nPlease amend the Stage and try again"); 

} else { 

window.open('https://calastone--sandbox.cs88.my.salesforce.com/setup/ui/recordtypeselect.jsp?ent=01Ib00000001BNO&retURL=%2Fa09%2Fo&save_new_url=%2Fa09%2Fe%3FretURL%3D%252Fa09%252Fo
&CF00Nb0000001uEZ9={!Opportunity.OwnerFullName}
&CF00Nb0000009fjvF={!Opportunity.Name}
&00Nb0000001uojJ="New"
&00Nb0000002Uvb5={!Opportunity.CTN_Service__c}
&CF00Nb00000039Pn4={!Opportunity.Account}
&CF00Nb0000002UvNo={!Account.TPA_Account__c}
&00Nb0000001uFSe={!Account.Client_Type__c}
&00Nb0000002UvIY={!Account.Primary_Regions__c}','_Parent');

}

Help, I am new so struggling to see what I have missed out

Thanks