I am attempting to change an engineered and release job from a BPM. By unchecking both fields. I performed a trace and tracked down the dataset, fields, and business objects. However, on calling the BO update, I get the error message: “Update not allowed, Engineered and Prevent Change”
I use BO JobEntry method GetByID to acquire the Job dataset.
Then I call the method ChangeJobHeadJobReleased, ChangedJobHeadJobEngineered, and Update.
When I changed the company configuration> production> Job> Change Engineered Jobs>, by unchecking “Prevent changes” the BPM does not report any error.
How can I make my BPM work without changing the company configuration?
Did you trace the whole process of changing a Released Job? I thought there was a pop-up that asked for details of the change (if I am remembering correctly). You would have to also provide something to satisfy that requirement.
Yes I traced the ds changes. I did for the audit log description. The problem is during the update method the reported error occurs. But when I changed the company configuration> production> Job> Change Engineered Jobs>, by unchecking “Prevent changes” the BPM does not report any error.
String vJobNum = callContextBpmData.Character20;
int vOrderNum = Convert.ToInt32(callContextBpmData.Number20);
// Declare svc as Assembly for JobEntry BO service.
var svc = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(Db); //Instanciated Server Side
// Uncheck Released and Engineered
// Get the Job DataSet using GetByID method
var dsv = svc.GetByID(vJobNum);
//var dsv = svc.GetDatasetForTree(vJobNum,0,0,false,"MFG,PRJ,SRV");
// Set JobRelease to false
dsv.JobHead[0].JobReleased=**false**;
// Set the row mode to update
dsv.JobHead[0].RowMod="U";
svc.ChangeJobHeadJobReleased(**ref** dsv);
// Set JobEngineered to false
dsv.JobHead[0].JobEngineered=**false**;
svc.ChangeJobHeadJobEngineered(**ref** dsv);
// Set discovered fields from trace accordingly.
dsv.JobHead[0].EnableJobFirm=**false**;
dsv.JobHead[0].EngineerAllowed=**true**;
dsv.JobHead[0].HeaderSensitive=**true**;
// Set Synchronize Req by Date With Demand Links field
dsv.JobHead[0].SyncReqBy=**true**;
// MGA - 12/12/2023
// save the dsv because Epicor will get cleared by the update and we would endup lossing the contents of the JobHeadAttch dataset table.
var dsv_save = dsv;
// Update the job
svc.Update(**ref** dsv);
// return;