End Activity add calculated refernce field

I am trying to add a “reference” field (as in i don’t need to save the field data) in the MES End Activity screen.

We would like to add:

  1. Production Qty
  2. Completed Qty
  3. Remaining Qty

to the End Activity MES screen.

I have already added a FKV for JobHead and a SubTable to JobOper - so i have the ProductionQty and the CompletedQty from the JobOper table.

However, I have not found a “Remaining” qty in JobOper.

Any suggestions on how to add this info to MES End Activity?

Thanks,
DaveO

Hi
Please can you provide more context as to why you want to do this…the standard functionality allows a user to start/stop activity against a job operation with 0 values against these fields so i am unsure as to why you need to do this?

Ms. Sue: our users would like to see the Job Operation Production Quantity, the Current Completed Qty and the Remaining Qty as reference fields.

I know this is not an unusual request - i have seen other references to the same thing - however the code examples are old and go back to 2008 and VB so they are not relevant anymore.

Thanks,
DaveO

I believe you will have to do the math yourself. RunQty-QtyCompleted = Remaining Qty.

1 Like

Just confirmed this is what we do on end activity.

1 Like

@gpayne and @Banderson thank you for the replies.

Sadly i am not a “coder” I only pretend to be one. Would either of you have an example of how I could make that work?

i.e. does the result need to be a database object or ClientBPMData? Or can i assign the result of a formula to a Form Object like a text box?

DaveO

let’s go low code and set the values in callContextBpmData. I tried a couple of other ways, but this seems clearer. I am not using an FKV although I started there. I added three fields to end activity. callContextBpmData. Number01, 02 and 03. This bpm has three Set callContextBpmData widgets. This select is for RunQty, then is an identical on for QtyCompleted and the third subtracts 2 from 1.

I would have only had one select in code, but it is one field each.

Db.JobOper.Where(jo=> jo.Company == CompanyID && resultLaborDtlRow.JobNum == jo.JobNum &&  resultLaborDtlRow.AssemblySeq == jo.AssemblySeq && resultLaborDtlRow.OprSeq == jo.OprSeq).Select(x=>  x.RunQty).FirstOrDefault()

E11 Qty End Act.bpm (19.3 KB)

Mr. @gpayne : Thank you so much for the BPM - I will give it a try.

I must confess i was thinking Form Code - but BPM I think will work just as well.

Again, thank you for the help.
DaveO