I working on a customization to automate the process of creating a CMI PO and then receiving it.
I am at the last step and I am stumped.
I have successfully created the Receipt and now I just need to mark it as received.
I did a trace on when I click the Received All checkbox on the Summary tab and it showed 4 method calls:
UpdateMaster (for some reason it calls this method twice)
I wrote my code to mimic the steps and parameters and the end result was that the header was marked as Received All but non of the lines were marked as Received so that parts were not in inventory.
I’m hoping someone can help me figure out how to mimic when a user clicks Receive All.
Do you have to use Receive All or can you use the method that is called when you check the Received box? Just putting another suggestion out there as that Receive All button is already a shortcut. If you are creating a BPM, I think you could just use the normal process.
I did try that before but I ran into an issue where it did not create the part transaction for all receipt lines except the first one. I was hoping to use the shortcut rather than figuring out why processing each line was not working.
Ah. Are you using the mass receipt functionality to bring in the lines or adding them 1 by 1 through the BPM?
I am adding them one by one.
After you add one, why not run the method that receives the line before moving onto the next line. Then at the end you should be able to run the method for when you click Received on the header.
Thanks for the suggestion, but I’m also getting stuck here too. It will check the box but not create the parttran record.
Here is my code.
foreach (var rdtl in rcptTableset.RcvDtl)
rcptSvc.CheckOnLeaveHead(rcptTableset.RcvHead.VendorNum, rcptTableset.RcvHead.PurPoint, rcptTableset.RcvHead.PackSlip, out warnMsg);
rdtl.RowMod = “U”;
rcptSvc.OnChangeDtlReceived(rcptTableset.RcvHead.VendorNum, rcptTableset.RcvHead.PurPoint, rcptTableset.RcvHead.PackSlip, rdtl.PackLine, true, ref rcptTableset);
rcptSvc.UpdateMaster(true, true, rcptTableset.RcvHead.VendorNum, rcptTableset.RcvHead.PurPoint, rcptTableset.RcvHead.PackSlip, rdtl.PackLine, out cLCAmtMessage, out opUpliftWarnMsg, out opReceiptWarnMsg, out opArriveWarnMsg, true, out qMessageStr, out sMessageStr, out lcMessageStr, out pcMessageStr, true, out qDtlComplianceMsgStr, false, out lCompliant, true, out lRequiresUserInput, false, rdtl.PartNum, “”, true, out lUpdateWasRun, out wrnLines, ref rcptTableset);