You need to sign in to do that
Don't have an account?
Cannot figure something simple out with Onclick Javascript button!
Hi everyone,
I keep getting an error with my onclick javascript button, "Unexpected identifier".
Would anyone mind taking a look at my syntax and letting me know what could be wrong? Thanks so much!!!!!!
if ( '{!Opportunity.Active__c}' == '')
{
alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated');
}
else if ('{!Opportunity.Rx_OTC__c}' == '')
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated');
}
else if ('{!Opportunity.Project_phase__c}' == '')
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated');
}
else if ('{!Opportunity.Description}' == '')
{alert('In order to request a Quote, you must ensure that the fields, Active, Product Type, Current Phase, and Project Scope for Patheon are populated');
}
else
{
window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name="Placeholder - Do Not Edit"
&00NA0000004pyaC=1&ent=Quote
&RecordType={!Opportunity.Quote_Record_Type__c}
&retURL=/{!Opportunity.Id}";
}
All Answers
window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name="Placeholder - Do Not Edit"
&00NA0000004pyaC=1&ent=Quote
&RecordType={!Opportunity.Quote_Record_Type__c}
&retURL=/{!Opportunity.Id}";
Hi sgupta, thank you for the response,
Unfortunately it doesn't look like the problem was with the quotes. I changed:
window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name="Placeholder - Do Not Edit"
&00NA0000004pyaC=1&ent=Quote
&RecordType={!Opportunity.Quote_Record_Type__c}
&retURL=/{!Opportunity.Id}";
To this:
window.location = "/0Q0/e?&oppid={!Opportunity.Id}&ent=Quote&Name='Placeholder - Do Not Edit'
&00NA0000004pyaC=1&ent=Quote
&RecordType={!Opportunity.Quote_Record_Type__c}
&retURL=/{!Opportunity.Id}";
....and it still didn't work.
Where do you go to get the javascript debugger? Thanks for your help!
The & and = parsing should grab the Name value as you might want.