API: getPicklistValues({ recordId, fieldApiName })
getPicklistValues({ recordId, fieldApiName }): This API provides information on retrieving the picklist values for a given field on a given object.
Usage in MAS is as follows:
const params = await $getInitParams();
const {
recordId }
= params || {
};
const picklistValues = await $getPicklistValues({
recordId, fieldApiName: 'SVMXC__Priority__c'}
);
Response:
{
"status":"success",
"data":[
{"active":true,"defaultValue":"false","label":"High","value":"High","validFor":null,"sfValidFor":null}
,
{"active":true,"defaultValue":"false","label":"Medium","value":"Medium","validFor":null,"sfValidFor":null}
,
{"active":true,"defaultValue":"false","label":"Low","value":"Low","validFor":null,"sfValidFor":null}
]
}
Was this helpful?