You need to sign in to do that
Don't have an account?
Chris Benenati
Accessing Custom Settings from within Custom Button definition
I defined a Custom Settings table with API name IDs__c to hold the field and record type identifiers I need when doing URL hacks to prepopulate new objects. I used a List type for the IDs__c and "Managed" it to create a record containing all of the definitions.
Then I try to create a custom button that references one of these settings. An example of a reference I try to use is:
"{!$Setup.IDs__c.ADDR_Household__c}"
If such a reference appears within the definition and I click "Check Syntax", I get told "There was an error communicating with the server." If I try to save the definition, I get told "An internal server error has occurred".
It doesn't matter if I use a simple URL definition (Behavior = Display in Existing Window) or JavaScript (Behavior = Execute JavaScript). I can even use the reference only within a string constant or in a JavaScript comment, and I get the same results.
Does anybody understand this?
Then I try to create a custom button that references one of these settings. An example of a reference I try to use is:
"{!$Setup.IDs__c.ADDR_Household__c}"
If such a reference appears within the definition and I click "Check Syntax", I get told "There was an error communicating with the server." If I try to save the definition, I get told "An internal server error has occurred".
It doesn't matter if I use a simple URL definition (Behavior = Display in Existing Window) or JavaScript (Behavior = Execute JavaScript). I can even use the reference only within a string constant or in a JavaScript comment, and I get the same results.
Does anybody understand this?
All Answers
Example -- here is the definition of a functioning custom button:
/{!$ObjectType.Address__c}/e?
CF00N1500000FV1HX={!Household__c.Name}
& CF00N1500000FV1HX={!Household__c.Id}
& Name="This field will auto-fill on save"
& retURL=/{!Household__c.Id}
I just want to replace the the identifier "CF00N1500000FV1HX" with something like "{!$Setup.IDs__c.CON_Household_Name__c}" so I can change the definitions of all the identifiers in one place (the custom settings) when I re-deploy. Shouldn't that be do-able?
BTW, I have eliminated the server errors by changing my custom settings from a List type to a Hierarchy type (don't know what that made a difference). But I still can't get the references to work correctly.