You need to sign in to do that
Don't have an account?
dani a.ax940
Javascript error on Custom button click
Hi,
I am using one custom list button on one of the related list. But sometime when I click on this button I am getting the below error message:
A problem with the OnClick javascript for this button or link was encountered: Failed to execute send on 'XMLHttprequest': Failed to load 'https://cs21.salesforce.com/services/Soap/u/29.0'.
One thing to note here is that this error message is not coming all the time. But I need to fix this one. Below is my JS code for this button:
{! REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}
var RecordTypeQuery = "Select Id from RecordType where developername='Set_Up_Plan' and SObjectType='Activity_Plan__c'";
var recordtype= sforce.connection.query(RecordTypeQuery );
var records = recordtype.getArray("records");
window.open("/{!$Setup.Org_Level_Settings__c.Activity_Plan_Prefix__c}/e?CF{!$Setup.Org_Level_Settings__c.Activity_Plan_ICP_Field_Id__c}={!JSENCODE(Account.Name)}&CF{!$Setup.Org_Level_Settings__c.Activity_Plan_ICP_Field_Id__c}_lkid={!Account.Id}&RecordType="+records[0].Id+"&retURL={!Account.Id}","_parent");
Any help is much appreciated. Thanks in advance.
I am using one custom list button on one of the related list. But sometime when I click on this button I am getting the below error message:
A problem with the OnClick javascript for this button or link was encountered: Failed to execute send on 'XMLHttprequest': Failed to load 'https://cs21.salesforce.com/services/Soap/u/29.0'.
One thing to note here is that this error message is not coming all the time. But I need to fix this one. Below is my JS code for this button:
{! REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}
var RecordTypeQuery = "Select Id from RecordType where developername='Set_Up_Plan' and SObjectType='Activity_Plan__c'";
var recordtype= sforce.connection.query(RecordTypeQuery );
var records = recordtype.getArray("records");
window.open("/{!$Setup.Org_Level_Settings__c.Activity_Plan_Prefix__c}/e?CF{!$Setup.Org_Level_Settings__c.Activity_Plan_ICP_Field_Id__c}={!JSENCODE(Account.Name)}&CF{!$Setup.Org_Level_Settings__c.Activity_Plan_ICP_Field_Id__c}_lkid={!Account.Id}&RecordType="+records[0].Id+"&retURL={!Account.Id}","_parent");
Any help is much appreciated. Thanks in advance.
Update the version of your connection.js as shown below:
{! REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
Let me know whether it helps to solve your problem
OR
Let me know the cause so I can try to solve :)
Warm Regards,
Darshan Shah