Skip to main content

Hello everyone ,

So I’am trying to stop the creation of a new customer payment order if the client is not approved ( I have a approval template attached to the customer screen) .

Here is my script (it’s a event action ) to get you a better idea of my requirement :

 

My problem is that when the script finds an unapproved customer, it triggers the error message and rollback, but it doesn’t check the next customer.

I’ve tried to use CONTINUE in the ELSE statement, but it doesn’t work .

Well, I’m not sure if some of your tokenizing and parameterizing logics are correct. Check again with the usage of the parameter selected_vouchers_.

However, once an error is raised, the transaction will rollback to it’s original state right before the failed statement \ logic, hence it’ll not reach to your next LOC. Therefore, I’d use a subprogram with EXCEPTION handling, i.e. something like the below.

Begin

  PROCEDURE exe_(<params>)

  …

  <raise the error>

  ...

  EXCPTION

    WHEN OTHERN THEN

       <do something like logging the error, etc>

  END;

BEGIN

  FOR i_ in <loop> LOOP

    exe_(<params>);

  END LOOP;

END;

 


 

 

 


Thank you Manulak !


Reply