Sample eScript for Custom Business Service After Commit

Once you have configured the user property for Custom Business Service After Commit with a value CustomerBusinessService:AfterCommit.

Following is the sample reference for eScript for AfterCommit method.

function Service_PreInvokeMethod (MethodName, Inputs, Outputs)

{

     try

     {

          var returnVal = ContinueOperation;

          if (MethodName =="AfterCommit")

          {

               // Add the logic to process Inputs and call external 3rd party system

               // If (external system update has failed)

               {

                    Outputs.SetProperty("CustomBSErrorCode", "Error message from external system.");

                    TheApplication().RaiseErrorText("Error message from external system.");

                    returnVal = CancelOperation;

               }

          }

          return returnVal;

     }

     catch (e)

     {

          throw e;

     }

}