API: $db.get
$db.get: With this API you can query data. This API takes a query object and a call back and returns a JSON in response. The sample $db.get code is as follows:
const filterCondition1 = {
sequence: 4,
left_operand: "SVMXC__Service_Order__c",
operator: "=",
right_operand: [
recordId
],
right_operand_type: "Value"

}
;
const inputData = {
object: 'SVMXC__Service_Order_Line__c',
filter: [
filterCondition1
],
fields: [
'Id',
'Name',
'SVMXC__Line_Type__c',
'SVMXC__Work_Description__c',
'SVMXC__Line_Status__c'
]

}
;
$db.get(inputData,
function(inputData,
response) {
const output = response.results;
$log('getRecord result : ',
output);
createTableRowsFromJSON(
output,
[
'Name',
'SVMXC__Line_Type__c',
'SVMXC__Work_Description__c',
'SVMXC__Line_Status__c'
],
'workLineRows',
'work_detail_view_sfm',
'SVMXC__Service_Order_Line__c',
);
$log('Completed rendering work detail list');

}
);
Was this helpful?