BPM to check that material is issued

Hi,
I have this BPM that triggers a pop up to warn that material is not issued. I only want this to trigger on the final operation. I get an error when I try to add in the JobAsmbl.FinalOp = True field. I am not sure where to add it.

for each ttLaborDtl where (ttLaborDtl.RowMod = ‘U’ or ttLaborDtl.RowMod = ‘A’)

[AND JobAsmbl.FinalOp = True - This is where I think it should go but I get an error when I put it here]

, each JobMtl where (JobMtl.RequiredQty > 0 AND not JobMtl.IssuedQty = JobMtl.RequiredQty) and (ttLaborDtl.Company = JobMtl.Company and ttLaborDtl.JobNum = JobMtl.JobNum) no-lock

Thanks,
Melissa

FinalOP is numeric. You want to check against the labordtl.oprseq. For speed don’t put the conditions in the where clause use an If then next to skip records you don’t want.

If JobAsmbl.FinalOp <> laborDtl.OprSeq then next.

Thanks for the suggestion. I am getting the error:

“JobAsmbl.FinalOpr must be a quoted constant or an unabbreviated. unambiguous biffer/field reference for buffers known to query” ?

You need a find or for each with JobAsmbl

I do something similar but I do the check for issued materials at job close.

Good afternoon,
Due to long lead times, we want to stock some material at a vendor for use in their production process. We would purchase the material and send it to the vendor. They would produce our item and sell it to us at their price less the material cost. We don’t really want to have to issue jobs for this process.
My thought was to sell the raw material to the vendor and discount it out to $0.00. The vendor would then produce our item and sell it back to us at Gross Price less material allowance (which we would discount out).
I can’t find anywhere on our P.O. where we could enter a discount amount in order to preserve the costing.
Does anyone have a better idea?
Thanks in advance.
Kerry TravisControllerInternational Name Plate Supplies Limited

Sorry, I didn’t change the subject when I entered my own question.
Good afternoon,
Due to long lead times, we want to stock some material at a vendor for use in their production process. We would purchase the material and send it to the vendor. They would produce our item and sell it to us at their price less the material cost. We don’t really want to have to issue jobs for this process.
My thought was to sell the raw material to the vendor and discount it out to $0.00. The vendor would then produce our item and sell it back to us at Gross Price less material allowance (which we would discount out).
I can’t find anywhere on our P.O. where we could enter a discount amount in order to preserve the costing.
Does anyone have a better idea?
Thanks in advance.
Kerry TravisControllerInternational Name Plate Supplies Limited Visit Topic or reply to this email to respond.

Hi there, not sure if this got resolved but what is the full code for checking that material is issued to the job.

would it be possible for you to share the full code for this?

I think this is what I had mocked up out of our routine. It validates, but has not been tested. Our final audit is FINAUD, so that was easiest for me to check. If you have various final operations, then you will need to check JobAsmbl for the final op number.

Alert on not enough material issued.p (1.4 KB)

Did you ever get this BPM to work in E10? Which method did you use?

Hi,
We have it running to check material each time someone marks the operation as complete.

Labor.Update Pre-Process

Condition: the LaborDtl.OpComplete field of the changed row is equal to the true expression

True = Execute custom code:

Erp.Tables.JobMtl JobMtl;
foreach (var ttLaborDtl_iterator in (from ttLaborDtl_Row in ttLaborDtl
where string.Equals(ttLaborDtl_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase) && string.Compare(ttLaborDtl_Row.LaborType, “P”, true) == 0
select ttLaborDtl_Row))
{
var ttLaborDtlRow = ttLaborDtl_iterator;
foreach (var JobMtl_iterator in (from JobMtl_Row in Db.JobMtl
where string.Compare(JobMtl_Row.Company, ttLaborDtlRow.Company, true) == 0 && string.Compare(JobMtl_Row.JobNum, ttLaborDtlRow.JobNum, true) == 0 && JobMtl_Row.AssemblySeq == ttLaborDtlRow.AssemblySeq &&
JobMtl_Row.RelatedOperation == ttLaborDtlRow.OprSeq
select JobMtl_Row))
{
JobMtl = JobMtl_iterator;
if (JobMtl.IssuedQty > 0)
{
continue;
}
if (JobMtl.QtyPer == 0)
{
continue;
}

    if (JobMtl.IssuedQty == 0)
    {

CallContext.Current.ExceptionManager.AddBLException(“Material " + JobMtl.PartNum + " not issued.”);
ttLaborDtlRow.LaborQty = 0;
}
}
}

Is that the full custom code? When I tried copy and pasting the code, I am getting syntax errors and unexpected characters. When I removed the CallContext then it seems to not error. What is the extra code inserted and the CallContext?

It is. The last part is the pop up box that tells the user which part is not issued and then it sets the labor qty to 0 so the op doesn’t close.

When I tried copy and paste the custom code, these are the errors. Anything I am missing?

change the fancy quote marks on these lines.

(ttLaborDtl_Row.LaborType, “P”, true)

(“Material " + JobMtl.PartNum + " not issued.”)

What are the pre-conditions and requirements needed on a job for the BPM to be triggered? I tried adding a new material seq and linked it to an operation but the BPM is still not triggering.

The material has to be linked to the op and the employee must choose COMPLETE when ending activity. It won’t trigger unless they are trying to close the operation.

I verified with a new job that the material is linked to the op and had it checked as Complete but the code is still not triggering. The show message does display but it seems like it is continuing through the custom code. Are there any other pre-conditions on the job to be required? Is this for both T&E and MES labor entries?

Even when I tried creating a new Job with a material linked to an operation, in T&E, when i complete the operation, the message is not being triggered. Something either in the code or my pre-conditions are not being met to trigger it correctly.