Is there a hook for me to tie into completion of the Run Billing Operations? (Transactions > Billing > Process Billing Operations) I'm not finding anything.
I want to run a map reduce script that groups invoices by contract after the billing operations have completed.
The map reduce script works fine, however I am not finding how I can tie it to the completion of the Run Billing Operations process
I've reviewed related SuiteAnswers articles, though am not finding the exact article that I need.
I found some articles that suggest I use a scheduled script to periodically pick up the invoices: 67449.
The problem with the scheduled script solution is that I want it to run automatically after the billing operations has finished. I don't want my user to have to click a second button to trigger the script or have to wait for the schedule to pick up the grouped invoices.
I found other articles that suggest I use an after submit on the invoice: 87747, 47805
The problem with this solution is that the Billing Operations is a process instead of a record. Therefore, I would have to tie the after submit to the invoice instead of the billing operation process itself. Since billing operations creates multiple invoices, I would need to find a way to see if the billing operations is currently running so I don't kick off the grouping too soon.
I've also seen some articles that suggest I can put the the aftersubmit on the billing schedule. I think this was a suiteanswers AI hallucination. I don't want it to run after a billing schedule, but after a billing operation has run.
Second Question:
Also, can I add a checkbox on the Billing Operations page to kick off my map-reduce script? From what I see, that page is not customizable and I would have to to write a suitelet that mimics the Billing Operations page. Is that correct?
Also, is there anything that I have incorrect in my above assessment or am overlooking? I would really appreciate any help.