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
sfdc sfdc 126sfdc sfdc 126 

A problem with onclick javascript for this button or link was encountered missing ) after argument list in javascript salesforce

Can Some one help me what is missing there .. it worked perfectly fine till today morning .. but suddenly i got the error some argument is missing

{!REQUIRESCRIPT("/soap/ajax/35.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/35.0/apex.js")}
if('{!Account.Account_Checked__c}'==1){ window.open('https://c.ap12.visual.force.com/apex/AccountChecked');
}
else{ window.open('_ui/core/email/author/EmailAuthor?p2_lkid={!Contact.Id}&p3={!Account.Name}&rtype=003&retURL=%2F{!Contact.Id}');
}
Deepak GulianDeepak Gulian
If Account_Checked__c is a checkbox field just do this
You dont need to add Requirescript , you can simply do this by below code:-

if({!Account.Account_Checked__c} == true) {
           window.open('/apex/AccountChecked');
}
else {
        window.open('_ui/core/email/author/EmailAuthor?p2_lkid={!Contact.Id}&p3={!Account.Name}&rtype=003&retURL=%2F{!Contact.Id}');
}
Nuevo9763Nuevo9763
Hi I am getting same error and I tried the above solution I tried both with and without Requirescript. I get same error.
{!REQUIRESCRIPT("/soap/ajax/35.0/apex.js")}
Neither o fthe below is working. I am using _target as I need to open the Email in a new tab. Please help.
{!REQUIRESCRIPT("/soap/ajax/35.0/apex.js")}

window.open('/email/author/EmailAuthor?p2_lkid={!param1}&p3_lkid={!param2}&retURL={!GC_Funding_Doc__c.Id}&p4='param3', '_target');

OR 

window.open('/email/author/EmailAuthor?p2_lkid={!param1}&p3_lkid={!param2}&retURL={!param3}&p4='param4', '_target');
Thanks,