In the form order, I created an “add new user” button.
I open the form for creating a new user in the modal and it should automatically close after insert and add a new user in the form_orders.
I managed this in the onAfterInsert event with
sc_commit_trans ();
[order_customer_id] = {customers_id};
sc_redir (form_orders.php, order_customer_id = [order_customer_id], “_parent”);
Now a problem arises when I try to create the next order.
Let’s say the new user ID was 22 and the name was Jon Doe
In each subsequent entry a new order is user 22 - Jon Doe
Where do I make a mistake?
I tried to reset the global variable but it doesn’t work.
Can anyone advise me?