I’m attempting to automate inspection processing for a specific use case we need in receipts. I’ve ran a trace and found the “InspectReceipt” function. I’ve successfully gotten the function to process an inspection, but the PO that is waiting for the inspection to finish does not get it’s “PassedQty” updated and stays in the “Inspection” status.
Here is the code in question. It’s on a Standard Data Directive on RcvDtl:
foreach (var rcv in ttRcvDtl.Where(dtl => dtl.RowMod != "" && dtl.RowMod != "D" && dtl.PONum != 0))
{
//...
//do auto inspection
string msg = "";
var insp = ServiceRenderer.GetService <Erp.Contracts.InspProcessingSvcContract>(Db);
Erp.Tablesets.InspProcessingTableset inspTs = new Erp.Tablesets.InspProcessingTableset();
//get inspection for receipt
inspTs = insp.GetReceiptByID(rcv.VendorNum, "", rcv.PackSlip, rcv.PackLine);
inspTs.InspRcpt[0].InspectorID = "AUTO";
inspTs.InspRcpt[0].InspectedBy = "AUTO";
inspTs.InspRcpt[0].InspectorIDName = "AUTO";
inspTs.InspRcpt[0].PassedQty = rcv.OurQty;
inspTs.InspRcpt[0].Done = true;
inspTs.InspRcpt[0].RowMod = "U";
string legalNumMsg = "";
int iDMRNum = 0;
int iNonConfID = 0;
insp.InspectReceipt(out legalNumMsg, out iDMRNum, out iNonConfID, ref inspTs);
}
Using the GetReceiptByID, editing the fields, and using InspectReceipt the same way in the BL Test tool has the expected results of the PO line closing since inspection has been completed.
Here’s some screen shots of the result of the code inspection:
NonConf Table:
PO Status:


PORel Table:
Any help/direction of why the PO does not update right would be appreciated. Thanks!
