Is it possible to populate the custom field picklist values into a custom button javascript code? Any pointers on how to use Schema.DescribeFieldResult class in javascript?
I am actually working on a jQuery modal dialog to create a new contact. I want to bring the role picklist values of Contact into my jQuery code. The button is on related list of standard page layout.
Best Answer
Here is a quick example using the Opportunity and stage name to console log the output. Not sure where your button is but this would be a custom button on the opportunity.
Basically everything available in the SOAP API is available via the AJAX toolkit. You just have to get the javascript correct. Here is a link to the AJAX toolkit documentation...
https://resources.docs.salesforce.com/sfdc/pdf/apex_ajax.pdf
Where does this button reside? It makes a difference on how you go about it. Maybe a code sample for what you have?
To get a list of options in APEX via the controller you could use:
Then use that in your javascript. This can also be done via Javascript Remoting....