You need to sign in to do that
Don't have an account?
Ross Gilbert 19
This is an onclick javascript button that is on a contact page layout, allowing the user to create a new opportunity. Seems to work most of the time but occasionally it doesn't, with the error "missing ) after arguments list". Wondering if anyone knows why this would happen on some contacts not others.
Javascript error on custom List Button
{!REQUIRESCRIPT("/xdomain/xdomain.js")} {!REQUIRESCRIPT("/soap/ajax/33.0/connection.js")} {!REQUIRESCRIPT("/support/console/33.0/integration.js")} var a = {!LEN( $Setup.New_Opportunity_Settings__c.RecordTypeId__c )}; if (a > 0) { window.parent.navigateToUrl('/006/e?retURL={!Contact.Id}&RecordType={!$Setup.New_Opportunity_Settings__c.RecordTypeId__c}&{!$Setup.New_Opportunity_Settings__c.ContactFieldNameId__c}={!Contact.Name}&{!$Setup.New_Opportunity_Settings__c.PrimaryContactFieldId__c}={!Contact.Id}&accid={!Account.Id}'); } else { window.parent.navigateToUrl('/setup/ui/recordtypeselect.jsp?ent=Opportunity&retURL={!Contact.Id}&save_new_url=/006/e?retURL={!Contact.Id}&{!$Setup.New_Opportunity_Settings__c.ContactFieldNameId__c}={!Contact.Name}&{!$Setup.New_Opportunity_Settings__c.PrimaryContactFieldId__c}={!Contact.Id}&accid={!Account.Id}'); }
This is an onclick javascript button that is on a contact page layout, allowing the user to create a new opportunity. Seems to work most of the time but occasionally it doesn't, with the error "missing ) after arguments list". Wondering if anyone knows why this would happen on some contacts not others.
All Answers
I would recommend to use google chrome developer tools(settings>more tools>developer tools) to see the exact line of error to trace better.
It might be because of any missing value on the current contact in context.
Regards,
Bharathimohan Ramamurthy
Salesforce For All (http://salesforceforall.blogspot.com/)