You need to sign in to do that
Don't have an account?
Avinash Vellala
Javascript button error "Unexpected token else"
Hi I am trying to Update the RecordType using a javascript button. The script is throwing an error whenever I press the button. Below is my code.
Thanks,
Avinash
{!REQUIRESCRIPT("/soap/ajax/40.0/connection.js")} var ICJ = new sforce.SObject("ICP_Contract_Join__c"); ICJ.id = '{!ICP_Contract_Join__c.Id}'; var BussinessRT = '0126E0000000Kk7'; var DevRT = '0126E0000000KkC'; IF ( ICJ.RecordType == BusinessRT ) { ICJ.RecordType = DevRT ; } else { icjObj.RecordType = BusinessRT ; } sforce.connection.update([icjObj]);
Thanks,
Avinash
Avinash Vellala
I have made some corrections the code is still failing.
Raj Vakati
try some think like this
Avinash Vellala
Thanks Rajamohan. I had to change acc.RecordType.id to acc.RecordTypeId and it worked.