You need to sign in to do that
Don't have an account?
Sean O-Connell
Java Script Button with Validation
I am looking to create a JavaScript Button with validation in to. I want it to check to see if "State of Incorporation" (A picklist) is not null if null give an alert if not run the code. Currently I am getting the below error and the code is also below thanks in advance for help
A problem with the OnClick JavaScript for this button or link was encountered:
Unexpected token {
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
if("{!Contact.State_of_Incorporation__c}" !==""{
var CRL='Email~VeraAuthorizedSigner@vera.com;FirstName~Vera;LastName~Authorized Signer;RoutingOrder~2;SignNow~0,Email~{!Contact.Email};Role~Signer 2;FirstName~{!Contact.FirstName};LastName~{!Contact.LastName};RoutingOrder~1;SignNow~0';
var DST ="AEF6F08B-B40F-4D11-A639-8B3B9604963D";
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Contact.Id}&CRL="+CRL+"&DST="+DST;
}
else{
Alert("must fill out State of Incorporation");
A problem with the OnClick JavaScript for this button or link was encountered:
Unexpected token {
{!REQUIRESCRIPT("/apex/dsfs__DocuSign_JavaScript")}
if("{!Contact.State_of_Incorporation__c}" !==""{
var CRL='Email~VeraAuthorizedSigner@vera.com;FirstName~Vera;LastName~Authorized Signer;RoutingOrder~2;SignNow~0,Email~{!Contact.Email};Role~Signer 2;FirstName~{!Contact.FirstName};LastName~{!Contact.LastName};RoutingOrder~1;SignNow~0';
var DST ="AEF6F08B-B40F-4D11-A639-8B3B9604963D";
window.location.href = "/apex/dsfs__DocuSign_CreateEnvelope?DSEID=0&SourceID={!Contact.Id}&CRL="+CRL+"&DST="+DST;
}
else{
Alert("must fill out State of Incorporation");
SalesFORCE_enFORCEr
I don't see any closing bracket for else. Also, you don;t need double equals in not equals, it will be !=
Pramodh Kumar
Try this.
Hans Liss
The "if" statement is missing a closing parenthesis:
That might be the reason for the "Unexpected token {" error.