I have created custom event to release every purchase order just after saving.
Than, when I save new purchase order, nothing happens. The purchase order 433184 is still in “Planned” state. No errors of the event, nothing.
What is wrong with it? Where should I look for error?
Thanks in advance
Jan
Best answer by dsj
Hi @westjan
Event you made is triggers when a new Purchase order is created. Since the event runs within the same transaction as creating the record, the select does not ‘see’ the record since the transaction is still not committed.
To avoid that, you can run your code as a background job, which would run after the roder is created.
Check this post for more details on running a code block as a background job
Event you made is triggers when a new Purchase order is created. Since the event runs within the same transaction as creating the record, the select does not ‘see’ the record since the transaction is still not committed.
To avoid that, you can run your code as a background job, which would run after the roder is created.
Check this post for more details on running a code block as a background job
Please proceed with Damith’s suggestion if you want to Release Purchase Order with PO header creation only else you can configure your event at Purchase Order Line instead.
System getting null values for Objid and Objversion with your select statement.