MES Start Setup Activity customization

Hello,

We added some custom columns to the JobOper table. We would like to save this data from the MES Start Setup Activity form. We were able to bind the fields to the JobOper table but then realized that it is read-only using the foreign key view. I have been trying some C# code to update these columns but have come up short. Any idea’s on how we can save this data back to the JobOper table from the Start Setup Activity?

As far as I know there is no adapter that can access the JobOperTable on that form

There is one for Labor. What type of info are you trying to save at the JobOper level?

I think you could probably use the JobEntryAdapter, do a GetByID and then access that table perhaps. (JobEntryAdapter.JobEntryDataSet.JobOper)

But are you sure this is where you want to be storing the data?

I would pass the value to a BPM with a UD field on LaborDtl or BPMCallContext. Then, in the BPM, set the value on JobOper.
If you do it in a customization, you will need extra code to ensure it is only written when the form is closed with the OK button.

i agree with Jason, but you need to cater for updating record restriction as Epicor Base will not allow updating any records on this table once the job is released

Thanks Chris. We are a sewing company and one of the operations involves a fabric usage calculator (Yards, Inches, Ply’s etc…) currently based in Excel. I am looking to capture this information for the operation in the system.

Is this intended to be a usage per activity - or the job as a whole? Either way - if you were to log usage per activity (Labor), you can sum it together at the end.

Can you help me understand the link of doing at start activity and storing it on the JobOper?

Thanks Jason and A.Baeisa. I have only been working with Epicor for a few months so I am certainly not an expert. I’ll do some research on the options provided and see what I can get to work.

Chris, It will be a few one time calculator values for the whole operation. Since these calculations\values are done for the operation it seemed like the place to store the data. I’m new to Epicor so if there is a better location to save this data I am open to suggestions.

Here is the calculator that I am trying to save a few pieces of data from. I currently have an updatable BAQ that will update the values I want. I was able to call the BAQ using the button and see the values I want to update. Is there a way to update those values using that same dynamic query call with updatable BAQ from the button?

Is this all custom work - i.e there are no repeatable jobs? Are the calculations done at the time of Start Activity - or ahead of time?

What I am getting at is that it sounds like this would be more of a function that would be completed at the creation of the BOM/MOM.

Otherwise, are you building this job on the fly? I’ve done a customization in the past that adds material to a job - sounds like it would be a similar process.

They are repeatable jobs and this calculator is completed at the time of start activity. I believe this calculation is done out on the floor as the cut file for the fabric cutter can be updated by engineering and change how many pieces we get per yard of material.

I see - so someone on the floor cuts and updates that value - then engineer will go in and adjust the MOM/BOM?

I don’t believe the BOM is updated using the calculator values. The operators compare the final yard value from the calculator to their paperwork for the job and if the two numbers are off by a lot they know something is wrong.

If I am reading this correctly, I believe you are missing the “Issue Material” step. You can over issue and you can setup on the Job Material an assumed scrap, you can even scrap material from the job. If these steps are too cumbersome, I would recommend finding a consultant (shameless plug) that can do some process automation to perform these steps based on the fields you show on the Setup screen. It is likely that these steps can be performed via a customization, but no promises.

1 Like

Thanks Jason

After combining pieces of code I found on the internet, the code below is saving the calculator values back to the JobOper table using an updatable BAQ.

private void epiButtonC1_Click(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
DynamicQueryAdapter dqa_JobMaterial = new DynamicQueryAdapter(oTrans);
     dqa_JobMaterial.BOConnect();

QueryExecutionDataSet qeds = dqa_JobMaterial.GetQueryExecutionParametersByID("CS_JobMaterial_Summary");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("JobNum",epiTextBoxC1.Text , "nvarchar",false, Guid.NewGuid(),"A");
qeds.ExecutionParameter.AddExecutionParameterRow("OperSeq",epiTextBoxC2.Text , "nvarchar" ,false, Guid.NewGuid(),"A");
qeds.ExecutionParameter.AddExecutionParameterRow("Assembly",epiTextBoxC5.Text , "nvarchar" ,false, Guid.NewGuid(),"A");
dqa_JobMaterial.ExecuteByID("CS_JobMaterial_Summary",qeds);

     EpiDataView edv_JobMaterial;
     edv_JobMaterial = new EpiDataView();
     edv_JobMaterial.dataView = new DataView(dqa_JobMaterial.QueryResults.Tables["Results"]);
     oTrans.Add("edv_JobMaterial", edv_JobMaterial);

     DataTable results = dqa_JobMaterial.QueryResults.Tables["Results"];

// Lets Loop through our results

			if (dqa_JobMaterial.QueryResults.Tables["Results"].Rows.Count > 0)
			{
				foreach (DataRow item in dqa_JobMaterial.QueryResults.Tables["Results"].Rows)

				{
item.BeginEdit(); 
item["JobOper_Begin_Yards_C"] = epiNumericEditorC1.Value;
item["JobOper_Total_Inches_C"] = epiNumericEditorC5.Value;
item["JobOper_Plys_C"] = epiNumericEditorC6.Value;
item["JobOper_Total_Inches_Used_C"] = epiNumericEditorC7.Value;
item["JobOper_Total_Scrap_C"] = epiNumericEditorC8.Value;
item["JobOper_Total_Defect_C"] = epiNumericEditorC10.Value;
item["JobOper_Total_Yards_Used_C"] = epiNumericEditorC12.Value;
item.EndEdit(); 
}
}
// End loop

  DataSet dsSend = new DataSet();

  edv_JobMaterial.dataView.RowStateFilter = DataViewRowState.ModifiedCurrent;
  DataTable table = edv_JobMaterial.dataView.ToTable();

  dsSend.Tables.Add(table);

  DataSet dsReturn = dqa_JobMaterial.Update("CS_JobMaterial_Summary", dsSend );
  edv_JobMaterial.dataView.Table.Clear();

     dqa_JobMaterial.Dispose();
     dqa_JobMaterial = null;

}
2 Likes