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
MaverickDevMaverickDev 

Can not access custom setting in Lead list button which executes JS script

Hello,

My client had installed our managed package into their Enterprise account. There is a lead list view button which is used to execute javascript and also check if data is there in custom setting field. Here is the sample js code;
{!REQUIRESCRIPT("/soap/ajax/26.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit 
{!REQUIRESCRIPT("/soap/ajax/26.0/apex.js")} 
var auId = '{!$Setup.Org__UserDetails__c.ID__c}'; 

alert('{!$Setup.Org__UserDetails__c.ID__c}'); -- gives an error message
 After configuring resp. button to Lead list view, it is throwing an error on click and shows ;
"A problem with the OnClick JavaScript for this button or link was encountered:
Could not access the following field: $Setup.Org__UserDetails__c.ID__c. Contact your administrator."


Respective user has system administrator profile, then to it is showing this error when they hit resp. button (refer image plz). 
Can anyone tell me why this is happening and what can be done to resolve this issue?


User-added image

User-added image