Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Layout Operations
getPicklist

The getPicklist query returns an array of the available picklist values and labels for the supplied field, or an empty array. You should provide the Record Type if your object's Record Types use different layouts with different picklist labels. Also dependent picklists can be used by providing a sample value of the primary (depended on) picklist.

var request = { 
	"type" : "getPicklist",
	"object" : "Account",
	"data" : {
        "RecordTypeId" : "001234567891234", // optional
        "SomeControllingField" : "someValue" // optional, data to set primary field(s) for dependent picklist
    },
	"fieldName" : "type"  // required
};
bridge.sendRequest(request, function (results) {
	if (results.type === "picklistResponse")	{
    	var picklistValues = results.data.itemIds; // returns an array of the valid salesforce picklist values
    	var picklistLabels = results.data.itemLabels; // returns an array of the valid salesforce picklist labels
	} else if (results.type == 'error') {
         errStr = results.data;
         alert('A problem occurred:\n' + errStr);
   }
}); 

getUnfilteredPicklist

The getUnfilteredPicklist query returns an unfiltered array of the picklist values and labels for the supplied field. You should provide the Record Type if your object's Record Types use different layouts with different picklist labels.

var request = { 
	"type" : "getUnfilteredPicklist",
	"object" : "Account",
	"data" : { "RecordTypeId" : "001234567891234" }, // data to describe the type of object
	"fieldName" : "type"  // required
};
bridge.sendRequest(request, function (results) {
	if (results.type === "picklistResponse")	{
    	var picklistValues = results.data.itemIds; // returns an array of all salesforce picklist values
    	var picklistLabels = results.data.itemLabels; // returns an array of all salesforce picklist labels
	} else if (results.type == 'error') {
         errStr = results.data;
         alert('A problem occurred:\n' + errStr);
   }
}); 

  • No labels