I am trying to populate a purchase order based on data pulled from another database.
I have created a custom GP form in VS2012, and able to populate the purchase order header information, (Vendor ID, Vendor Name, Date, Buyer ID, Currency ID), but when it comes to the line items I run into problems.
First, I am only able to create one line item; I don't know the flags/commands to tell the code I am on a new purchase order line. I have tried several flags:
PopPoEntry.PopPoLineState.InsertingLine.Value = true;
PopPoEntry.PopPoLineState.IsAddingNew.Value = true;
PopPoEntry.PopPoLineState.RunValidate();
PopPoEntry.LocalNewLine.Value = true;
PopPoEntry.LocalNewLine.RunValidate();
Second, the line I do add, just vanishes after the code completes. The Item Number, U of M, Qty Ordered, Unit Cost, Description, Site ID, Qty Canceled, and Extended cost are all populated, but when the procedure ends, the line item vanishes with out any error or notification.
I am guessing my newly entered item is failing validation, but I am not sure where. I have made sure the Vendor Item is created, the Item exists and the Site ID, and the Site ID is specified as the default site.
Any help on this will be greatly appreciated.
*This post is locked for comments