You can use the ExecuteQuery and FirstRecord methods. Assume you locate the following code in Step 2:
business_service.prototype.Submit = function () {
retObj = bc.ExecuteQuery();
err = retObj.err;
if(!err){
retObj = bc.FirstRecord();
if(!retObj.err){
//Do an operation here that sets the return value to bRet
return({err:false,retVal:bRet});
}
}
else{
SiebelApp.S_App.OfflineErrorObject.SetErrorMsg("messageKey", errParamArray);
return({err:true});
}
};
- where business_service identifies the name of the business service that your custom code calls. For example, PharmaCallSubmitsvc.
For more information, see SetErrorMsg Method, FirstRecord Method and ExecuteQuery Method.
In this example, you replace the code that you located in Step 2 with the following code:
PharmaCallSubmitsvc.prototype.Submit = function () {
var currRetValue={err:false}, retObj;
retObj=bc.ExecuteQuery();
err = retObj.err;
if(!err){
retObj=bc.FirstRecord();
if(!retObj.err){
//Do an operation here that sets the return value to bRet
currRetValue={err:false,retVal:bRet};
}
}
else{
SiebelApp.S_App.OfflineErrorObject.SetErrorMsg("messageKey", errParamArray);
currRetValue={err:true};
}
return currRetValue;
};