I am trying to use a data directive on the PODetail table to create a new Job. This code creates the job (entries in JobHead, JobPart, and JobProd) but does not create the entries in JobAsmbl, JobMtl, JobOpDtl, or JobOper. I am using a part with an approved revision with 1 operation and 1 material defined. When I use quick job entry through Epicor or through BL tester it creates fine but I have not figured out what I am missing. The only thing I saw different in the table entries was in table JobPart; the revision number is not there for the jobs I try to create through this BPM.
Erp.Contracts.JobEntrySvcContract job = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.JobEntrySvcContract>(this.Db, true);
Erp.Contracts.QuickJobEntrySvcContract quickjob = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.QuickJobEntrySvcContract>(this.Db, true);
Erp.Tablesets.QuickJobEntryTableset dsjob = new Erp.Tablesets.QuickJobEntryTableset();
string Rst;
string JobNum;
string PartNum;
string RevNum;
Guid bGuid;
string UOM;
string serial;
string ques;
bool multi;
PartNum=“TS05259TOPM1RS00”;
bGuid= new Guid(“00000000-0000-0000-0000-000000000000”);
UOM=“EA”;
RevNum = “1”;
//Create new job
job.GetNextJobNum(out JobNum);
dsjob = quickjob.GetNewQuickJob(JobNum);
dsjob.QuickJob[0].PartNum = PartNum;
dsjob.QuickJob[0].RevisionNum = RevNum;
dsjob.QuickJob[0].Quantity = 4;
dsjob.QuickJob[0].Firm = true;
dsjob.QuickJob[0].JobDate = DateTime.Parse("11/10/2021");
dsjob.QuickJob[0].EnableEngineered = true;
dsjob.QuickJob[0].EnableReleased = true;
dsjob.QuickJob[0].QuantityUOM = UOM;
quickjob.GetPartXRefInfo(ref PartNum,bGuid,"",ref UOM,out serial,out ques,out multi);
quickjob.ChangeQuickJobPartNum(ref dsjob,UOM);
dsjob.QuickJob[0].WarehouseCode = "SAM";
quickjob.ChangeQuickJobWarehouseCode(ref dsjob);
quickjob.ValidateJobInfo(ref dsjob);
quickjob.PreGenerateJob(ref dsjob,out multi);
quickjob.GenerateJob(ref dsjob,out Rst);
base.PublishInfoMessage("Job " + JobNum,0,0,"","");