Hi
I recently started using the Nav ODATA Webservices. They work fine for the sales invoices. I can add a sales invoice and add lines to the sales invoice using the ODATA POST method. However when I want to add a purchase invoice line I get errors. When I add a new Purchase Invoice, the invoice is added and I get the invoice number returned. I use that invoice number to add purchase invoice lines according to the XML as you can see below. However this returns the error:
Document No. must have a value in Purchase Line: Document Type=Invoice, Document No.=, Line No.=0. It cannot be zero or empty
This is strange because the document no is provided in the XML and line No. is not the number I entered. Is this a bug Nav?
Patrick
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<category term="NAV.Purchase_InvoicePurchLines" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<id />
<title />
<updated>2014-06-13T08:40:50Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Document_Type>Invoice</d:Document_Type>
<d:Document_No>1009</d:Document_No>
<d:Line_No m:type="Edm.Int32">10000</d:Line_No>
<d:Type>Item</d:Type>
<d:No>1001</d:No>
<d:Cross_Reference_No />
<d:IC_Partner_Code />
<d:IC_Partner_Ref_Type xml:space="preserve"></d:IC_Partner_Ref_Type>
<d:IC_Partner_Reference />
<d:Variant_Code />
<d:Nonstock m:type="Edm.Boolean">false</d:Nonstock>
<d:Gen_Bus_Posting_Group>EXPORT</d:Gen_Bus_Posting_Group>
<d:Gen_Prod_Posting_Group>DET.HANDEL</d:Gen_Prod_Posting_Group>
<d:VAT_Bus_Posting_Group>EXPORT</d:VAT_Bus_Posting_Group>
<d:VAT_Prod_Posting_Group>BTW19</d:VAT_Prod_Posting_Group>
<d:Description>Tourfiets</d:Description>
<d:Description_2 />
<d:Certificate_Required m:type="Edm.Boolean">false</d:Certificate_Required>
<d:Certificate_Received m:type="Edm.Boolean">false</d:Certificate_Received>
<d:Certificate_Receipt_Date m:type="Edm.DateTime">0001-01-01T00:00:00</d:Certificate_Receipt_Date>
<d:Return_Reason_Code />
<d:Location_Code />
<d:Bin_Code />
<d:Quantity m:type="Edm.Decimal">1</d:Quantity>
<d:Unit_of_Measure_Code>STUKS</d:Unit_of_Measure_Code>
<d:Unit_of_Measure>Piece</d:Unit_of_Measure>
<d:Quantity_Price_UoM m:type="Edm.Decimal">0</d:Quantity_Price_UoM>
<d:Price_Unit_of_Measure_Code />
<d:Price_Unit_of_Measure />
<d:Direct_Unit_Cost_Price_UoM m:type="Edm.Decimal">0</d:Direct_Unit_Cost_Price_UoM>
<d:Direct_Unit_Cost m:type="Edm.Decimal">0</d:Direct_Unit_Cost>
<d:Indirect_Cost_Percent m:type="Edm.Decimal">0</d:Indirect_Cost_Percent>
<d:Unit_Cost_LCY m:type="Edm.Decimal">350.595</d:Unit_Cost_LCY>
<d:Unit_Price_LCY m:type="Edm.Decimal">4000</d:Unit_Price_LCY>
<d:Line_Amount m:type="Edm.Decimal">0</d:Line_Amount>
<d:Line_Discount_Percent m:type="Edm.Decimal">0</d:Line_Discount_Percent>
<d:Line_Discount_Amount m:type="Edm.Decimal">0</d:Line_Discount_Amount>
<d:Allow_Invoice_Disc m:type="Edm.Boolean">true</d:Allow_Invoice_Disc>
<d:Inv_Discount_Amount m:type="Edm.Decimal">0</d:Inv_Discount_Amount>
<d:Amount m:type="Edm.Decimal">0</d:Amount>
<d:Amount_Including_VAT m:type="Edm.Decimal">0</d:Amount_Including_VAT>
<d:Allow_Item_Charge_Assignment m:type="Edm.Boolean">true</d:Allow_Item_Charge_Assignment>
<d:Qty_to_Assign m:type="Edm.Decimal">0</d:Qty_to_Assign>
<d:Qty_Assigned m:type="Edm.Decimal">0</d:Qty_Assigned>
<d:Job_No />
<d:Job_Task_No />
<d:Job_Line_Type xml:space="preserve"></d:Job_Line_Type>
<d:Job_Unit_Price m:type="Edm.Decimal">0</d:Job_Unit_Price>
<d:Job_Line_Amount m:type="Edm.Decimal">0</d:Job_Line_Amount>
<d:Job_Line_Discount_Amount m:type="Edm.Decimal">0</d:Job_Line_Discount_Amount>
<d:Job_Line_Discount_Percent m:type="Edm.Decimal">0</d:Job_Line_Discount_Percent>
<d:Job_Total_Price m:type="Edm.Decimal">0</d:Job_Total_Price>
<d:Job_Unit_Price_LCY m:type="Edm.Decimal">0</d:Job_Unit_Price_LCY>
<d:Job_Total_Price_LCY m:type="Edm.Decimal">0</d:Job_Total_Price_LCY>
<d:Job_Line_Amount_LCY m:type="Edm.Decimal">0</d:Job_Line_Amount_LCY>
<d:Job_Line_Disc_Amount_LCY m:type="Edm.Decimal">0</d:Job_Line_Disc_Amount_LCY>
<d:Prod_Order_No />
<d:Blanket_Order_No />
<d:Blanket_Order_Line_No m:type="Edm.Int32">0</d:Blanket_Order_Line_No>
<d:Insurance_No />
<d:Budgeted_FA_No />
<d:FA_Posting_Type xml:space="preserve"></d:FA_Posting_Type>
<d:Depreciation_Book_Code />
<d:Depr_until_FA_Posting_Date m:type="Edm.Boolean">false</d:Depr_until_FA_Posting_Date>
<d:Depr_Acquisition_Cost m:type="Edm.Boolean">false</d:Depr_Acquisition_Cost>
<d:Duplicate_in_Depreciation_Book />
<d:Use_Duplication_List m:type="Edm.Boolean">false</d:Use_Duplication_List>
<d:Appl_to_Item_Entry m:type="Edm.Int32">0</d:Appl_to_Item_Entry>
<d:Shortcut_Dimension_1_Code />
<d:Shortcut_Dimension_2_Code />
<d:ShortcutDimCode_x005B_3_x005D_ />
<d:ShortcutDimCode_x005B_4_x005D_>70</d:ShortcutDimCode_x005B_4_x005D_>
<d:ShortcutDimCode_x005B_5_x005D_ />
<d:ShortcutDimCode_x005B_6_x005D_ />
<d:ShortcutDimCode_x005B_7_x005D_ />
<d:ShortcutDimCode_x005B_8_x005D_ />
</m:properties>
</content>
</entry>
I recently started using the Nav ODATA Webservices. They work fine for the sales invoices. I can add a sales invoice and add lines to the sales invoice using the ODATA POST method. However when I want to add a purchase invoice line I get errors. When I add a new Purchase Invoice, the invoice is added and I get the invoice number returned. I use that invoice number to add purchase invoice lines according to the XML as you can see below. However this returns the error:
Document No. must have a value in Purchase Line: Document Type=Invoice, Document No.=, Line No.=0. It cannot be zero or empty
This is strange because the document no is provided in the XML and line No. is not the number I entered. Is this a bug Nav?
Patrick
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<category term="NAV.Purchase_InvoicePurchLines" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<id />
<title />
<updated>2014-06-13T08:40:50Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Document_Type>Invoice</d:Document_Type>
<d:Document_No>1009</d:Document_No>
<d:Line_No m:type="Edm.Int32">10000</d:Line_No>
<d:Type>Item</d:Type>
<d:No>1001</d:No>
<d:Cross_Reference_No />
<d:IC_Partner_Code />
<d:IC_Partner_Ref_Type xml:space="preserve"></d:IC_Partner_Ref_Type>
<d:IC_Partner_Reference />
<d:Variant_Code />
<d:Nonstock m:type="Edm.Boolean">false</d:Nonstock>
<d:Gen_Bus_Posting_Group>EXPORT</d:Gen_Bus_Posting_Group>
<d:Gen_Prod_Posting_Group>DET.HANDEL</d:Gen_Prod_Posting_Group>
<d:VAT_Bus_Posting_Group>EXPORT</d:VAT_Bus_Posting_Group>
<d:VAT_Prod_Posting_Group>BTW19</d:VAT_Prod_Posting_Group>
<d:Description>Tourfiets</d:Description>
<d:Description_2 />
<d:Certificate_Required m:type="Edm.Boolean">false</d:Certificate_Required>
<d:Certificate_Received m:type="Edm.Boolean">false</d:Certificate_Received>
<d:Certificate_Receipt_Date m:type="Edm.DateTime">0001-01-01T00:00:00</d:Certificate_Receipt_Date>
<d:Return_Reason_Code />
<d:Location_Code />
<d:Bin_Code />
<d:Quantity m:type="Edm.Decimal">1</d:Quantity>
<d:Unit_of_Measure_Code>STUKS</d:Unit_of_Measure_Code>
<d:Unit_of_Measure>Piece</d:Unit_of_Measure>
<d:Quantity_Price_UoM m:type="Edm.Decimal">0</d:Quantity_Price_UoM>
<d:Price_Unit_of_Measure_Code />
<d:Price_Unit_of_Measure />
<d:Direct_Unit_Cost_Price_UoM m:type="Edm.Decimal">0</d:Direct_Unit_Cost_Price_UoM>
<d:Direct_Unit_Cost m:type="Edm.Decimal">0</d:Direct_Unit_Cost>
<d:Indirect_Cost_Percent m:type="Edm.Decimal">0</d:Indirect_Cost_Percent>
<d:Unit_Cost_LCY m:type="Edm.Decimal">350.595</d:Unit_Cost_LCY>
<d:Unit_Price_LCY m:type="Edm.Decimal">4000</d:Unit_Price_LCY>
<d:Line_Amount m:type="Edm.Decimal">0</d:Line_Amount>
<d:Line_Discount_Percent m:type="Edm.Decimal">0</d:Line_Discount_Percent>
<d:Line_Discount_Amount m:type="Edm.Decimal">0</d:Line_Discount_Amount>
<d:Allow_Invoice_Disc m:type="Edm.Boolean">true</d:Allow_Invoice_Disc>
<d:Inv_Discount_Amount m:type="Edm.Decimal">0</d:Inv_Discount_Amount>
<d:Amount m:type="Edm.Decimal">0</d:Amount>
<d:Amount_Including_VAT m:type="Edm.Decimal">0</d:Amount_Including_VAT>
<d:Allow_Item_Charge_Assignment m:type="Edm.Boolean">true</d:Allow_Item_Charge_Assignment>
<d:Qty_to_Assign m:type="Edm.Decimal">0</d:Qty_to_Assign>
<d:Qty_Assigned m:type="Edm.Decimal">0</d:Qty_Assigned>
<d:Job_No />
<d:Job_Task_No />
<d:Job_Line_Type xml:space="preserve"></d:Job_Line_Type>
<d:Job_Unit_Price m:type="Edm.Decimal">0</d:Job_Unit_Price>
<d:Job_Line_Amount m:type="Edm.Decimal">0</d:Job_Line_Amount>
<d:Job_Line_Discount_Amount m:type="Edm.Decimal">0</d:Job_Line_Discount_Amount>
<d:Job_Line_Discount_Percent m:type="Edm.Decimal">0</d:Job_Line_Discount_Percent>
<d:Job_Total_Price m:type="Edm.Decimal">0</d:Job_Total_Price>
<d:Job_Unit_Price_LCY m:type="Edm.Decimal">0</d:Job_Unit_Price_LCY>
<d:Job_Total_Price_LCY m:type="Edm.Decimal">0</d:Job_Total_Price_LCY>
<d:Job_Line_Amount_LCY m:type="Edm.Decimal">0</d:Job_Line_Amount_LCY>
<d:Job_Line_Disc_Amount_LCY m:type="Edm.Decimal">0</d:Job_Line_Disc_Amount_LCY>
<d:Prod_Order_No />
<d:Blanket_Order_No />
<d:Blanket_Order_Line_No m:type="Edm.Int32">0</d:Blanket_Order_Line_No>
<d:Insurance_No />
<d:Budgeted_FA_No />
<d:FA_Posting_Type xml:space="preserve"></d:FA_Posting_Type>
<d:Depreciation_Book_Code />
<d:Depr_until_FA_Posting_Date m:type="Edm.Boolean">false</d:Depr_until_FA_Posting_Date>
<d:Depr_Acquisition_Cost m:type="Edm.Boolean">false</d:Depr_Acquisition_Cost>
<d:Duplicate_in_Depreciation_Book />
<d:Use_Duplication_List m:type="Edm.Boolean">false</d:Use_Duplication_List>
<d:Appl_to_Item_Entry m:type="Edm.Int32">0</d:Appl_to_Item_Entry>
<d:Shortcut_Dimension_1_Code />
<d:Shortcut_Dimension_2_Code />
<d:ShortcutDimCode_x005B_3_x005D_ />
<d:ShortcutDimCode_x005B_4_x005D_>70</d:ShortcutDimCode_x005B_4_x005D_>
<d:ShortcutDimCode_x005B_5_x005D_ />
<d:ShortcutDimCode_x005B_6_x005D_ />
<d:ShortcutDimCode_x005B_7_x005D_ />
<d:ShortcutDimCode_x005B_8_x005D_ />
</m:properties>
</content>
</entry>