I want to have an informational message show up as soon as the job number is entered in Job Receipts to Inventory - if there is Salvage Material - to receive the Salvage first.
I have looked at the trace data and have tried Pre-Processing on ReceiptsFromMfg.GetNewReceiptsFromMfgJobAsm.and it does not pop up until the receipt has been processed.
I was able to put a message on post-processing ReceiptsFromMfg.EnableSerialMatching which happens after the job is entered and before GetNewReceipts fires.
We don’t deal with salvage, so I don’t know where that is stored, but I would assume you could do some simple abl code to check for salvage existing and put up the message if it did.
If you can tell me where the data is stored I will throw the basic together.
That does seems to be a dead end. I got an idea about using CallContextClient from an old post between Jose and Rob in 2013 which looks like it will work for this. The callcontextclient.AssemblyName is Epicor.Mfg.UI.RcptToInvEntry.
On JobEntry.GetByID pre processing which is what the Receipt to Inventory calls to get the job set the condition below.
Then in Actions do ABL code something like this.
/* check for Salvage */
Disable triggers for load of JobMtl.
define variable InfoMsg as character init ‘’.
For Each JobMtl fields ( SalvageQtyPer ) no-lock where JobMtl.Company = cur-comp and JobMtl.JobNum = JobNum.
/* If not SalvageQtyPer > 0 then next. */ /* uncomment after testing */
If ttCallContextBpmData.Checkbox01 = true then next.
InfoMsg = "Salvage exists - do that first ".
{lib/PublishInfoMsg.i &InfoMsg = InfoMsg}.
ttCallContextBpmData.Checkbox01 = true.
End.
I don’t know what exact fields you would need, but put only the ones you want in the fields () in the for each and once it is running skip and jobmtl records that don’t qualify to make it run faster.
I set the checkbox01 to true and then skipped if it was true because I got multiple popups when I tested.
It may not apply to this, but a consultant showed me that as a way to speed up code, especially when you are doing updates. It stops any behind the scenes logic from firing in your bpm.
The other thing he told me was to not include conditions in the where clause and instead use the If condition then next to skip records.