Developer forum

Forum » Integration » OData: Import Prices & Discounts (New price experience)

OData: Import Prices & Discounts (New price experience)

Michael Knudsen
Reply

I'm new to OData, but I hope someone have a quick answer to my questions below.

Is it possible from a DW9 solution to use the same endpoints as decribed below or is it restricted to DW10?
https://doc.dynamicweb.dev/manual/tutorials/integration/blueprints/bc-odata-v4-blueprint.html#import-prices--discounts-new-price-experience

Is it required to install any app on Business Central in order to get the endpoints exposed as described below? Or is it only a configuration in Business Central that needs to be done?
https://doc.dynamicweb.dev/manual/tutorials/integration/blueprints/bc-odata-v4-blueprint.html

Br. Michael Knudsen


Replies

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply
This post has been marked as an answer

Hi Michael Knudsen,
 

Fetching the Prices and Discounts from a Busines Central with New Price Experience is the same in DW9 and DW10. In DW9 it is not possible to download the Blueprint and use them directly, but you can replicate the mapping setup described in the tutorial. 

BR Rasmus Sanggaard

 

Votes for this answer: 1
 
Michael Knudsen
Reply

Hello Rasmus,

- so everything works out-of-box on Business Central? No need to install an app or anything else?

Br. Michael Knudsen

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi,

 

Everything in the tutorial works without any installment of Code Units / Apps. You need to expose pages if you want to use the v4 approach, but it is all desribed in the tutorial. 

BR Rasmus Sanggaard

 
Michael Knudsen
Reply

Hello Rasmus,

- where do I find the "Business Central Object Id" for DynamicwebSalesPriceList ?
https://doc.dynamicweb.dev/manual/tutorials/integration/blueprints/bc-odata-v4-blueprint.html?q=odata#import-prices--discounts-new-price-experience

Seems to be missing in the object table:
https://doc.dynamicweb.dev/manual/tutorials/integration/blueprints/bc-odata-v4-blueprint.html?q=odata#business-central-v4-entities---imports

Br. Michael Knudsen 

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Michael,

The Object type is 7016 named Sales Price List. Our naming follows the naming in Business Central, so just mimicking the name should give you the right object type. However, I will add it to the table on the documentation site to reduce any confusion.

Thanks :)

BR Rasmus Sanggaard

 
Michael Knudsen
Reply

Pefect Rasmus, thanks for the update!

 
Michael Knudsen
Reply

Hello Rasmus,

- according to the 'Table 1' (https://doc.dynamicweb.dev/manual/tutorials/integration/blueprints/bc-odata-v4-blueprint.html#import-prices--discounts-new-price-experience) there is a number of fields missing, when I compare the OData I get from the endpoint /DynamicwebSalesPriceList (Object type 7016).

Is it a wrong Object type or is the documentation not up to date?

I'm missing the following:
- Variant_Code
- Unit_of_Measure_Code
- Minimum_Quantity
- Product_No
- Unit_Price
- Price_List_Code
- Line_No

Below is an exampel of what I get:

      "@odata.etag": "W/\"JzE5OzMxMzQwMTU4NzI5NDkzOTYzOTAxOzAwOyc=\"",
      "Code": "S00429",
      "Description": "xxx",
      "SourceType": "Customer",
      "JobSourceType": "All Projects",
      "AssignToParentNo": "",
      "SourceNo": "38460",
      "AssignToNo": "38460",
      "VATBusPostingGrPrice": "INDLAND",
      "PriceIncludesVAT": false,
      "AmountType": "Price & Discount",
      "Status": "Active",
      "CurrencyCode": "",
      "StartingDate": "0001-01-01",
      "EndingDate": "0001-01-01",
      "AllowUpdatingDefaults": true,
      "AllowInvoiceDisc": true,
      "AllowLineDisc": false

Br. Michael Knudsen

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Michael, 

 

These fields are from DynamicwebSalesPriceListLines. This object is accessible when you expose DynamicwebSalesPriceList.

 

BR Rasmus Sanggaard

 
Michael Knudsen
Reply

I have mixed something up, so I delete my post :-)

Br. Michael Knudsen

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Michael,

 

When exposing pages, 7016 is Sales Price List. When looking at the tables in the BC database "Sales Discount Access" also has object ID 7016, but has Object type Table. So there is Object ID and an Object Type. 

https://learn.microsoft.com/en-us/dynamics365/business-central/application/base-application/page/microsoft.sales.pricing.sales-price-list

 

BR Rasmus Sanggaard

 

You must be logged in to post in the forum