Good Afternoon All,
Here is my Goal: Update Mtl costs in job when Released
Further definition of Updated cost is — Should be Std Cost
What I have achieved so far is on the Method JobEntry.ChangeJobHeadJobReleased to capture when the Release checkbox is checked ( yes) .
I am able to retrieve the Job Number ( row ?? ) that is RowMod = “U”.
Where I am stuck is to cycle through the Materials . Once I am there I can ( I Believe I can…) check if the EstUnit cost = Std cost for that material. If not, change Est unit cost to Std Cost.
I have tried this on a Data Directive but can only capture if a Mtl row has actually changed.
Here is the Code I have so far…
int c = 0; // counter
decimal stdCost = 0; // Std Cost of Mtl
decimal estCost = 0; // Est Cost of Mtl
foreach(var dset in ds.JobHead.Where(dset => dset.Company == callContextClient.CurrentCompany
&& dset.RowMod == "U"
&& dset.JobReleased == true))
{
c = c + 1;
Epicor.Customization.Bpm.InfoMessage.Publish
("Pre Process RowMod = " + dset.RowMod + "\n"
+ "Released = " + dset.JobReleased) ;
foreach(var mtl in ds.JobMtl)
{
Epicor.Customization.Bpm.InfoMessage.Publish
("PN = " + mtl.PartNum);
// code to check and update here///
}
}
Epicor.Customization.Bpm.InfoMessage.Publish
("c = " + c.ToString() ) ;
This is related to another post I did regarding Job Costs and DMT updated costs. Halfway thinking this approach could work via DMT just un-releasing, re-releasing jobs
All thoughts and input are appreciated. Trying to get this going before Ya’ll head to Insights. I cant go this year …
Dean