Last active
April 13, 2017 09:00
-
-
Save bmodeprogrammer/0fcc65f201bc87f64d4610aa9e4b7c76 to your computer and use it in GitHub Desktop.
Get picklist values JavaScript Remoting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/soap/ajax/39.0/connection.js" type="text/javascript"></script> | |
<script> | |
sforce.connection.sessionId = '{!$Api.Session_ID}'; | |
var result = sforce.connection.describeSObject("Opportunity"); | |
for (var i = 0, size = result.fields.length; i < size; i++) { | |
var field = result.fields[i]; | |
if (field.name === 'StageName') { | |
var oPicklistVals = field.picklistValues; | |
for (var b = 0; b < oPicklistVals.length; b++) { | |
console.log(oPicklistVals[b].value); | |
} | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment