Hi,
I am retrying a BPM I was working on a little while ago. I want to check that the material related to the operation they are clocking out of has been issued. I don’t get any errors but I don’t get the warning when I expect it.
I have a method directive, pre-processing on Labor.EndEctivityComplete
my query is:
for each ttLaborDtl no-lock , each JobMtl no-lock where
(ttLaborDtl.Company = JobMtl.Company and ttLaborDtl.JobNum = JobMtl.JobNum
and ttLaborDtl.AssemblySeq = JobMtl.AssemblySeq and ttLaborDtl.OprSeq =
JobMtl.RelatedOperation and JobMtl.IssuedQty = 0 )
And the action is raise exception with my message.
First put just an informational message to make sure the method is getting called.
I do something like this on reporting quantities on Labor.Update. I took that bpm and changed it to do a material check on labor update. This is not condition and abl code.
code is below and marked as code - thanks @Chris_Conn
Greg
/* Stopping if Mtl not issued */
For each ttLaborDtl where ttLaborDtl.RowMod = 'U' and ttLaborDtl.LaborType = "P" no-lock.
For Each JobMtl Where JobMtl.Company = ttLaborDtl.Company and JobMtl.JobNum = ttLaborDtl.JobNum and JobMtl.AssemblySeq = ttLaborDtl.AssemblySeq and
JobMtl.RelatedOperation = ttLaborDtl.OprSeq no-lock.
If JobMtl.IssuedQty > 0 then next.
If JobMtl.IssuedQty = 0 Then DO:
{lib/PublishEx.i &ExMsg = "'Material ' + JobMtl.PartNum + ' not issued.'"}.
assign ttLaborDtl.LaborQty = 0.
End.
End.
End.