Basically require a little assistance with the last bit of a BPM (Pre Processing).
What I would like to achieve is once the data is submitted in the JOB.MTL table I would like to update the JOB.OPER table in the field QtyPer (Qty/Parent) ONLY where the OpCode = “MAT” with the following result from the JOB.MTL data formula.
Post Processing BPM on JobEntry.Update
Where JobMtl has been Add / Changed
Then you’d have to write some custom C# code (or use the workflow items to call the BO’s to update the appropriate JobOpr) the code would look something like this (mind you I am not syntax checking this… but it should get you close)
foreach(var jm in ttJobMtl.Where(r=>r.Updated()||r.Added())
{
var jo = (from jobOpr in Db.JobOper where jobOpr.Company == jm.Company && jobOpr.JobNum == jm.JobNum && jobOpr.OpCode =="MAT" select jobOpr).FirstOrDefault();
if(jo!=null)
{
//Do your formula work and assignment here
}
}
Db.Validate();