MES End Activity - Display Next Operation

Could really use some help in getting the Next Assembly, Operation fields to display when you End Activity in MES. These fields are always blank when I clock out of a job operation. I have seen screen shots online of other users and for some reason these fields work for them.

I cannot find a company/site setting or anything in Operation, Job Entry, or other menu’s that describe how to enable these fields.

In creating my BPM which would send out an email alert if the Next Operation Description meets the criteria I noticed when creating the email template there is a field called EnableNextOprSeq - a boolean. I tried setting this field to true in my BPM thinking maybe it had to be enabled to pull in and display the next Assembly, Operation Seq, and Operation Description fields but this did not work either.

Any ideas? Why are these fields greyed out when there are subsequent assemblies or operations?

Odd, they should just show up. Does the operation have a valid resource group? Is the job scheduled?
Send some more screenshots of your job settings.

I’ve customized the End Activity screen, but those fields just worked OOTB.
image

Ending activity on a job in MES - same screen on different job operations.

Job Entry for said job:

Operation Setup:

Resource is active and valid far as I can tell:

I do not understand why following assembly/operations do not show up on the End Activity screen. Without these fields being populated I am unable to create my BPM email alert.

You can check for the next oper in the bpm and only send the email if the condition is met.

Greg,

When creating a send email alert BPM (pre-processing Method Directive ERP.BO.Labor.Update) there are fields for NextAsm, NextOprSeq, NextOprDesc which is what I am trying to use in my email alert. Since MES is, for some reason, leaving the next Assembly and Operation fields blank which is my real issue, I cannot use these fields.

Specifically, I am trying to create a BPM that will send out an email notification when the next job operation is ENG or, Project Engineering. Engineering will get the email when they are up next on a job operation.

I would like to know why the next assembly/operation fields are blank for my environment when I see other users do not have this issue. I could not find a site/company setting nor any specific flag in Job Entry that would prevent this from showing up. If those fields start populating as they should be I can then add to my BPM condition statement and send out the email alert.

Below is the BPM currently. Note that the second line of the condition only works currently as “” meaning blank. Since the next operation description is not being populated correctly the email will only get sent out if the condition is set to blank.

Here is what the email looks like. I included the fields mentioned earlier to see what would come through:

image

Next Operation Seq and Next Operation Desc are blank.

1 Like

Man nothing sticks out to me and I don’t see anything in KB. I’d open a ticket with Epicor.

@geofmcguire Those fields are not in the database, but are in the LaborDtl dataset.

I have no idea if they hold data for you (I am assuming not) so I did it two ways. This would be a custom block before your condition and then you would check for You should also do a set field to clear the BpmContext values after the email to be a good citizen…

/* Set next Opr */
callContextBpmData.Number01 = 0;
callContextBpmData.Character01 = string.Empty;

// end activity - you could add the OpCode = ENG, etc
var ttLaborDtlRow = (from ttLaborDtl_Row in ds.LaborDtl
                       where ttLaborDtl_Row.Company == Session.CompanyID 
                       && ttLaborDtl_Row.Updated() && ttLaborDtl_Row.ActiveTrans == true
                       && ttLaborDtl_Row.ClockOutMinute != 24m
                       select ttLaborDtl_Row).FirstOrDefault();

{
Ice.Diagnostics.Log.WriteEntry("in set next step");
var nextStep =  (from jo in Db.JobOper
                where 
                jo.Company == ttLaborDtlRow.Company && jo.JobNum == ttLaborDtlRow.JobNum &&
                jo.OprSeq >  ttLaborDtlRow.OprSeq
                orderby jo.OprSeq                                            
                select new { jo.OprSeq, jo.Description }).FirstOrDefault();
  if (nextStep != null)
  {
    
    
      Ice.Diagnostics.Log.WriteEntry($" next Opr Is {nextStep.OprSeq}");
    callContextBpmData.Number01 = nextStep.OprSeq;
    callContextBpmData.Character01 = nextStep.Description;
    
    //callContextBpmData.Number01 = ttLaborDtlRow.NextOprSeq;
    //callContextBpmData.Character01 = ttLaborDtlRow.NextOperDesc; 
    //Ice.Diagnostics.Log.WriteEntry($" next Opr Is {ttLaborDtlRow.NextOprSeq}");
        
  }
 }


Greg,

What you say tracks. Checking a BAQ for LaborDtl you are right the next assembly and next operation fields are not in the database, but rather the data set. Since they are not bound I guess I can’t tap them. That said, why would Epicor include them in the email alert as potential fields to use? Would it not stand to reason that if my next assembly/operation fields were populating as they do for other users they would work in my email alert? If they show up as populated in MES I would think they would carry over to the email even if they are in the data set. Those fields still being blank I do not get and if they should be populated as they are for others it would be good to at least try that approach before custom code which will likely slow down every clock out transaction in MES as it runs though code searching for the next job operation code to = ENG.

I am not fluent in C# but understand nearly all of the code you wrote - thank you for that Greg. Couple of questions on that:

  1. && ttLaborDtl_Row.ClockOutMinute != 24m - is the “24” reference time specific to when the operation is clocked out? I am not sure what this row of code does.

  2. I would include my ttLaborDtl_Row.OpCode = ENG in this section if I am specifically looking for that Op Code?

  3. Ice.Diagnostics.Log.WriteEntry($" next Opr Is {nextStep.OprSeq}"); - your quotes indicating this is where I could reference my Operation code?

  4. I get your meaning to clear out my BPMData context fields Number01 and Character01 after the BPM and have seen that before with other custom code so the operation sequence and operation description do not remain in the BPM context fields. Not using these in any of my other BPM’s but still good to flush them at the end of the code.

  1. ClockOutMinute is set to 24 on a clock in, this makes sure you are only checking on clock out

  2. You are looking for the next operation to be ENG. If you add ENG it will be looking for the next ENG operation, not the next operation and the checking if it is ENG. You could add jo.OpCode to the list of fields and another if inside of nextStep != null to only set the callcontext values if OpCode == “ENG”, but that is the same as checking for ENG in the condition versus callContextBpmData.Character01 = “”

  3. WriteEntry writes to the Event Viewer on the App Server. I use it to see values or know a section of code ran.
    image

1 Like