You need to sign in to do that
Don't have an account?
gokubi
Get StageNames for a single Opp record type?
I've got working code to give me all Opp stagenames. I would like to narrow that list to values appropriate to one record type. I wasn't able to find a path to that in the documentation about the describeSObjects call.
Here's the working code:
Code:
Thanks in advance for any help!
Steve
Here's the working code:
Code:
function generateStageNamePicklist(picklistid) { var objects = sforce.connection.describeSObjects(["Opportunity"]); var OppObject = objects[0]; var OppSourcePicklistValues = new Array(); for (var i=0; i<OppObject.fields.length; i++) { if(OppObject.fields[i].name=="StageName") { var StageNameField = OppObject.fields[i]; StageNameFieldPicklistValues = StageNameField.picklistValues; } } SelectBox = "<select id='" + picklistid + "'>"; for (var currentStageName=0;currentStageName<StageNameFieldPicklistValues.length;currentStageName++) { SelectBox +="<option value="+ StageNameFieldPicklistValues[currentStageName].value +">" + StageNameFieldPicklistValues[currentStageName].value + "</option>"; } SelectBox +="</select>"; return SelectBox; }
Thanks in advance for any help!
Steve
Code: