You need to sign in to do that
Don't have an account?

Faster pickListValues lookup
Does anyone have a fast/faster/fastest way to load the values of a specific picklist in a custom s control?
I am currently using:
Code:
var describeResult = sforce.connection.describeSObject("Case"); var fieldMap = []; var fields = describeResult.getArray("fields"); for(var i =0; i<fields.length; i++) { fieldMap[fields[i].name] = fields[i]; } var fldType = fieldMap["Product_or_Service__c"]; var selType = document.getElementById('prodService'); for(var j=0;j<fldType.picklistValues.length;j++) { if(fldType.picklistValues[j].active) { selType.options[j] = new Option(fldType.picklistValues[j].label, fldType.picklistValues[j].value); selType.options[j].selected = (fldType.picklistValues[j].defaultValue == true); } }
which works, but its dog slow. Anyone have a faster solution? I always know exactly the name of the field I want the values for if that helps any.
Other than that I have no other tips. Sorry :(