Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Unable to Create Purchase Order Line using Nav 2016 Soap Services

Posted on by 4
Trying to create a purchase order via the SOAP webservices for Nav2016, however stuck on the following error.
 
 
There is no Purchase Line within the filter.  Filters: Document Type: Order, Document No.: POXXXXX)
 
Code below, looks fine to me , so wondering if its a configuration on the clients system.
 
Purchase_Header po = new Purchase_Header();
po.Buy_from_Vendor_No = /TEST01/;

po.Vendor_Invoice_No = /TEST0101/;
po.Document_Date = DateTime.Now;
po.Posting_Date = DateTime.Now;
 
Purchase_Order_Line[] ArrayPOLines = new Purchase_Order_Line[1];
Purchase_Order_Line poLine1 = new Purchase_Order_Line();
 
poLine1.Type = NavPurchaseOrderHeader.Type.Item;
poLine1.No = /100477/;
poLine1.Qty_to_Receive = 20;
poLine1.Direct_Unit_Cost = 100;

ArrayPOLines[0] = poLine1;
po.PurchLines = ArrayPOLines;
 
 
Thanks in advance
 
  • JSmith00887 Profile Picture
    JSmith00887 4 on at
    Unable to Create Purchase Order Line using Nav 2016 Soap Services
    Thanks Zhu
     
    I create the PO Header
     
    Then i add the purchase lines as an array and update but that is where i get the error.
     
    Purchase_Header PoHeader = new Purchase_Header();
    PoHeader.Buy_from_Vendor_No = "TEST";
    PoHeader.Document_Date = DateTime.Now;

    PurHeaderClient.Create(ref PoHeader);

    PoHeader.PurchLines = new Purchase_Order_Line[1];
    PoHeader.PurchLines[0] = new Purchase_Order_Line();

    PurHeaderClient.Update(ref PoHeader);
     
    The line in bold gives me the error of 
     
    There is no Purchase Line within the filter.
     
    Filters: Document Type: Order, Document No.: XXXXX
     
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,698 Super User 2024 Season 2 on at
    Unable to Create Purchase Order Line using Nav 2016 Soap Services
    I'm not sure. It seems that after the Purchase Header is created, there is no commit, and then the Purchase Line is created directly. So this error occurs.
     
    Hope this gives you some tips.
     
     
    Thanks
     
    ZHU

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans