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
-incuGuS--incuGuS- 

How to add a Custom Setting in a Custom Button

Hello Community,

 

I'm not able to add a Custom Setting value to a Custom Button onClick JS.

The error is :

Error: You referenced an unsupported field type called "Lookup" using the following field: Cid__c

 

When trying to reference :

 $Setup.CustomSetting__c.Cid__c

 

How can i reference a custom setting value inside the js of a onclick Js custom button?

-incuGuS--incuGuS-

Anyone got any ideas?

BenLBenL

If it is a hierarchy custom setting you may be able to use $Setup.<custom setting api name goes here>.<custom setting field name goes here>.  

 

For sure that will not work for a list custom setting.  In that case you can query it like any other object.