If anyone can help, I would love some suggestions. I am trying to complete a PO Receipt inspection using the InspectReceipt method. Almost everything works as expected, with the exception on the part transaction qty to stock. The method is creating the PartTran record, but the TranQty and POReceiptQty is zero every time. I get no errors and the InspectionPending clears from the receipt.
You may be missing some calls there. Run a trace and see exactly which methods are called. In my version is:
-AssignInspectorReceipt
-OnChangePassedQty (if you have passed qty’s)
-OnChangeFailedQty (if you have failed qty’s)
-CheckPlanningContractBin
-GetPassedLegalNumGenOpts
-InspectReceipt
Also, going back a little, if you’re passing all qty’s ‘by default’ and always have failed qty=0, why not just uncheck Inspection Required in the PO line ?
I am calling the method from a Classic dashboard. I am only passing the entire qty for now while testing. If I can get it working, the user will be able to enter the Pass/Fail qty as normal.
Also, just updating the InspectionRequired to false does not create the part transaction from inspection to stock. The parts will never show up in inventory.
Thanks again for the suggestions Dragos. I reorganized the code to do as you suggested, but it still has the same result. However… In the process of testing your suggestions, I was looking at the data again, and found the solution.
I use this code to write the values of the dataset to a CSV file before and after I make all the updates to the dataset…
When I was comparing the before and after dataset, I noticed a field named “DimPassedQty” that still had a value of zero after I performed the OnChangePassedQty method call. So I ran another test where I manually set the value of that field, and it worked! I now have a TranQty in the INS-STK part transaction.