Solved

Event trigger from background job completion

  • 19 December 2023
  • 2 replies
  • 103 views

Badge +1

Iam trying to create an event or even an api call would be fine for when a background job finishes.  Specifically "Create Pick List for Customer Order".  Our goal is to have the associated order’s PCKNOTE document text updated after the shipment is created from the background job.  I have a custom api call that updates it when I test from SQL but I can’t figure out how to get the event to trigger.  We tried when a new record is inserted into the FRT_SHIPPING_INFO_TAB table.

icon

Best answer by Marcel.Ausan 20 December 2023, 08:58

View original

2 replies

Userlevel 5
Badge +12

There is an application defined event already by the name “Background job is processed” and you can use that for executing the follow-up action. Just enter the event action parameters according to the background job you want to track

Userlevel 6
Badge +15

@Frank H if all you wanna do is send an email when some background job is finished, then you could use the standard event action with the available parameters.

Unfortunately, all standard event actions are for type Email and that can’t be changed. So if you wanna execute some PL/SQL block of code after a certain background job is finished, you could create a custom event on DeferredJob LU and put some conditions to make sure the event executes only when the job you need is completed. Additionally you can fetch some of the job attributes to identify business process objects (orders / shipment) to use them in the PL/SQL routine.

 

Reply