James Latimer Posted January 21, 2022 Share Posted January 21, 2022 I feel like there's something I'm missing. I can successfully create a Sales Order and a Purchase Order with line items in Sage50 using the .NET API (not ODBC). The issue I'm having is that while the correct vendor/customer are set, the address for that entity is not being set and is left blank. I can't seem to find anything in the API that will allow them to be filled out. Even setting the addresses manually still results in the items being blank. Is there something I'm not doing correctly? Vendor v = Peachtree_Functions.GetVendorByName("VENDOR NAME HERE"); PurchaseOrder po = Peachtree_Functions.Company.Factories.PurchaseOrderFactory.Create(); po.VendorReference = v.Key; po.CustomerReference = null; po.Date = DateTime.Now; po.ReferenceNumber = Peachtree_Functions.GetNewPONumber(); po.ShipToAddress.Address = v.MailToContact.Address; po.MainAddress.Address = v.MailToContact.Address; PurchaseOrderLine pol = po.AddLine(); pol.Quantity = 5; pol.UnitPrice = 2.55M; pol.Amount = pol.Quantity * pol.UnitPrice; pol.Description = "Test Line Item for Purchase Orders"; pol.InventoryItemReference = null; po.Save(); I've also attached a picture of the resultant Purchase Order screen. If I was to manually select the vendor the correct addresses would be filled out. Link to comment Share on other sites More sharing options...
Administrators Melanie Lisle Posted January 24, 2022 Administrators Share Posted January 24, 2022 Hi James, Thanks for your question. We currently don't support the US version of Sage 50 Accounts here on the Developer Community, but if you post your question on Sage City one of my colleagues will be able to help. Thanks, Mel Link to comment Share on other sites More sharing options...
James Latimer Posted January 26, 2022 Author Share Posted January 26, 2022 I've created a topic there. Please feel free to close this one. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now