Share ideas, ask questions, and get feedback about developing for ProcessMaker
Forum rules: Please post new questions under "Developing processes & programming" for ProcessMaker 2 or 3.
#5042
I have an SQL insert statement in a trigger that fires after the final step in a task. I'm using executeQuery() to run the SQL.

If the insert fails for whatever reason, the use sees a generic red "Trigger Error" message, but still has the Continue button which will just derivate to next task/user as if there was no problem. I need some way to make the error a little more obvious, but more importantly to keep the user in the case (until they track down the error or call for support).

Do errors in triggers always "block"? The example code for executeQuery() shows several instances of tests to run after the function to see what happened. Are there best practices for dealing with serious errors in PM triggers?
#5088
My suggestion is to use PMFSendMessage() to send am email to the sysadmin and use PauseCase() to pause the case. If you want to inform the user, you could create a DynaForm displaying the error message, and then redirect the user to see it using:
G::header("location:URL");
die();
or you could set the error message DynaForm to be the next step in the task, but set a condition to only display it if an error. After displaying the error message DynaForm, then pause the case.

Temu New user DIscount code Using Temu's DIscount […]

By using the Temu coupon code [acu600079], you can[…]

Yes, the Temu Coupon Code "aci384098" or[…]

Yes, the Temu Coupon Code "aci384098" do[…]