1

I have a script that's initializing my operations and it's calling a stored procedure.

What I'd like to have happen is if there's an error produced from that stored procedure, whether it be database specific or not, I want to cancel the operation chain.

I can't seem to get this to work.

Within the operation logs, I'll receive a warning about there being a database error, but even with having an OnError, Step 2 is still firing.

My thought is that if I can't do this in one script, I'll create another one that performs the condition and checks the last error and then have that one call Step 2. I'd like to avoid that overhead.

Thanks for your help.

Here's an example of what I'm trying to do:

CallStoredProcedure("<TAG></TAG>",
                  "INIT_INTEGRATION_RUN",
                  0,
                  "SF Cases",
                  $operationId);

//check for an error and if so, prevent the next operation from running
error = $jitterbit.operation.error;

WriteToOperationLog(error);
WriteToOperationLog($jitterbit.operation.last_error);

if(Length(error) > 0,CancelOperationChain("Error Initializing Integration Run"));

enter image description here

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Michael Stone
  • 950
  • 2
  • 14
  • 30
  • Have you tried using RaiseError instead of CancelOperationChain? I'm hitting the same type of problems, and that's what I'm trying but I haven't fully tested it yet. – MBulava Aug 17 '18 at 14:22
  • I'm facing same issue, RaiseError and CancelOperationChain doesn't stop the execution of the original operation. Any idea ? – user3012488 Nov 17 '20 at 10:03

0 Answers0