Company Config or BPM on Job Qty complete in MES

Is there a configuration checkbox to not allow qty completed on job activity to be greater than the qty on the job operation?

Or is a BPM needed to enforce this request?

Thanks,

1 Like

this has to be addressed with a BPM or you can also do a UI customization on End Activity. I’d go the BPM route first but watch for performance issues, i’ve seen it occur depending on the version you’re on with BPM’s on the Labor BO.

Thanks Rob

@rbucek
Will this be a BPM on the laborDTL?
I tried to use trace log on an MES end activity, but it doesnt appear to be tracing those transactions.

We added some custom code on the Labor.Update method.

You could use Widgets as well, but when we did this we were still code freaks.

foreach(var LaborDetail in ttLaborDtl.Where(ld=>(ld.Added() )))
{	
	
	var JobOper = Db.JobOper.Where(jo=> LaborDetail.Company == jo.Company
																	&& LaborDetail.JobNum == jo.JobNum 
																	&& LaborDetail.AssemblySeq == jo.AssemblySeq
																	&& LaborDetail.OprSeq == jo.OprSeq).FirstOrDefault();
	if(JobOper != null)		
	{
			
			
			if ( JobOper.QtyCompleted >= JobOper.RunQty) 
			{	
				var message =  "You are not allowed to start job activity on this operation.  The quanity completed (" +  Convert.ToInt32(JobOper.QtyCompleted) + ") is what is expected (" + Convert.ToInt32(JobOper.RunQty) + ") for this operation." + Environment.NewLine + Environment.NewLine + "If you are getting this message in error, please contact your supervisor.";

				throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage(message)	{Type = Ice.Common.BusinessObjectMessageType.Error,});

			}
		
		
		
	}
}

foreach(var LaborDetail in ttLaborDtl.Where(ld=>(ld.Updated() )))
{	
	
	var JobOper = Db.JobOper.Where(jo=> LaborDetail.Company == jo.Company
																	&& LaborDetail.JobNum == jo.JobNum 
																	&& LaborDetail.AssemblySeq == jo.AssemblySeq
																	&& LaborDetail.OprSeq == jo.OprSeq).FirstOrDefault();
	if(JobOper != null)		
	{
			
			
			if ((JobOper.RunQty) < ( LaborDetail.LaborQty + JobOper.QtyCompleted ))
			{	
				var message =  "You are not allowed to complete more on this operation than what is expected. (" + ( Convert.ToInt32(JobOper.RunQty) - Convert.ToInt32(JobOper.QtyCompleted) ) + ")" + Environment.NewLine + Environment.NewLine + "If you are getting this is in error, please contact your supervisor.";

				throw new Ice.Common.BusinessObjectException(new Ice.Common.BusinessObjectMessage(message)	{Type = Ice.Common.BusinessObjectMessageType.Error,});

			}
		
		
	}
}

Thank you Ken.
did this code restrict you from clocking rework if the quantity was complete?

Didn’t test that as we don’t have that business case.