$sfm_records.getPicklistValues API
$sfm_records.getPicklistValues API is used to retrieve the picklist values for a given field on header/child record by providing ID of the record and API name of the picklist field.
$sfm_records.setFieldValue API does not support insert or delete operations and supports only update operation.
$sfm_records.getPicklistValues(recordId,fieldApiName,callback);
Where
recordId is ID of the record for which the picklist value needs to be fetched
fieldApiName is the API Name of the picklist field
Sample request of $sfm_records.getPicklistValues API is mentioned below:
$sfm_records.getPicklistValues('a1y0R0000001dVmQAI','SVMXC__Order_Status__c',(respon-
se)=>{
var result = {
status: 'success',
error: '',
error_message: '',
}
$response(result);
}
);
Response structure of $sfm_records.getPicklistValues API is mentioned below:
{"data":[{"label":"Open","value":"Open"},{"label":"Closed","value":"Closed"},
{"label":"Canceled","value":"Canceled"},{"label":"Completed","value":"Completed"},
{"label":"Progress","value":"Progress"},{"label":"Accepted-English","
value":"Accepted"}],"status":"success","error":""}
It returns the picklist values of Work Order Status using the record IDand field Name.
Was this helpful?