web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

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

Unable to Create Purchase Order Line using Nav 2016 Soap Services

(1) ShareShare
ReportReport
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
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    93,032 Super User 2025 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
  • JSmith00887 Profile Picture
    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
     
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,808

#2
Sumit Singh Profile Picture

Sumit Singh 2,554

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,140

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans