$response({
status:'success’,error : '',error_message : ''});
$response({
status:’error’,error : ‘error’,error_message : ‘Invalid Parameters’}
);
$sfm_records.get(sfmData=>{
if (sfmData) {
$response({'status': 'success','error_message': ''});
} else {
$response({'status': 'error', error: 'error', error_message': 'SFM data is empty'});
}
});
$sfm_records.get(sfmData=>{
$response({'status': 'success','error_message': ''});
if (sfmData) {
//Continuing the logic.
$response({'status': 'success','error_message': ''});
} else {
$response({'status': 'error', error: 'error', error_message': 'SFM data is empty'});
}
});
|
|
• In web delivery, if the code does not specify where the error should appear, by default the validation error is displayed at the top in the header tooltip.
• In mobile, if the code does not specify where the error should appear, by default the validation error is displayed in the Overview tab of the ServiceMax Go app.
|
$response({
// result object
"error_message": "Some validation error occurred",
"validationType": "ERROR", // or WARNING
"relatedFields": [ // API names of related fields
"Header_Field__c"
],
"relatedChildFields": {
"1childsectionId1”: { // child line section id (labor/parts/etc type ids)
“2childrecordId2”: [ // record id
"Child_Field__c"
]
}
}
})