Saul
(Rivera)
January 13, 2022, 6:25pm
1
Hi,
I am trying to release a Job from an updatable BAQ but I always get an error: “Change Description is required”
I need to modify a JOB from a BAQ Updateable and that when saving it is marked as released
I had used some BO Methods but none works well.
foreach (var ttResultsRow in ttResults.Where(row=> row.Unchanged()))
{
var JobHead = Db.JobHead.Where(row=> row.Company == CompanyID && row.JobNum == ttResultsRow.JobHead_JobNum).FirstOrDefault();
if (JobHead != null)
{
JobHead.JobNum = ttResultsRow.JobHead_JobNum;
}
var JobSvc = Ice.Assemblies.ServiceRenderer.GetService < Erp.Contracts.JobEntrySvcContract > (Db);
Erp.Tablesets.JobEntryTableset JobData = new Erp.Tablesets.JobEntryTableset ();
JobSvc.GetNewJobAudit (ref JobData, JobHead.JobNum, BpmFunc.Now());
JobData.JobAudit[0].ChangeDescription="Test";
JobData.JobAudit[0].ChangeTime= 22222;
JobSvc.ChangeJobHeadJobEngineered (ref JobData);
JobData.JobHead[0].JobEngineered=true;
JobData.JobHead[0].JobReleased=true;
JobData.JobHead[0].ChangeDescription="Test";
JobSvc.Update (ref JobData);
}
Thanks
Nancy_Hoyt
(Nancy Hoyt)
January 13, 2022, 8:22pm
2
Hi Saul,
There’s a checkbox in company configuration called prevent changes on engineered jobs. Have you considered unchecking this to see if your updateable query works then?
Nancy
1 Like
Saul
(Rivera)
January 13, 2022, 8:47pm
3
Hi Nancy,
I can’t uncheck it because that is a condition of the company.
I removed the check to test and the error continues
Thanks
Saul
LMMoser
(Lisa Moser)
April 10, 2023, 6:09pm
4
Hi Saul,
Did you ever get this to work? I’m running into the same issue.
Thanks!
Lisa
gpayne
(Greg Payne)
April 10, 2023, 6:15pm
5
@LMMoser here is mine that works. I had to add the ValidateJobDuomAttributes to get it to happen in my version.
EDIT: To @Nancy_Hoyt ’s point I do not have Prevent Changes or Create Audit Log set. I can try that in test to see if it fails.
Ice.Diagnostics.Log.WriteEntry("In Release Job " + jobNum.ToString());
Erp.Tablesets.JobEntryTableset ds = new Erp.Tablesets.JobEntryTableset();
ds = job.GetByID(jobNum);
// ds.JobHead[0].JobEngineered = true ;
// ds.JobHead[0].JobReleased = true ;
job.ValidateJobDuomAttributes("JobReleased", jobNum, true, true);
ds.JobHead[0].JobReleased = true ;
ds.JobHead[0].RowMod = "U";
job.ChangeJobHeadJobReleased(ref ds);
job.Update(ref ds);
ttr.JobHead_JobReleased = true ;
klincecum
(Kevin Lincecum)
April 10, 2023, 6:25pm
6
@gpayne beat me to it
Calling wrong BO.
JobEntry.ChangeJobHeadJobReleased
nyamoga9
(Michel Baradosa)
September 11, 2024, 9:43pm
7
I am having similar challenges. All I need is to close the job and put some comments on the job comment text (maintenance jobs). Has anyone been successful closing maintenance jobs on updatable BAQ?