“Create Accounting” program creates SLA journal entries for events. As we ever mentioned in the post before, we can add some logic in preaccounting hook or postaccounting hook to do something before or after accounting. If you want to do something in preaccounting or postaccounting, you must know which events will/have be processed in the accounting program. How to get these event or transaction id?
Generally, you can get it from “p_report_request_id”. The request id will be updated to xla_events table and the request id will be shipped to hooks as a parameter. So you can get the event or transaction by below code in accounting hook.
FROM xla.xla_events xee,
WHERE xee.application_id = XXX
AND xee.event_id = xte.event_id
AND …… –any other condition you want to add
AND XEE.request_id = p_report_request_id;