Developer forum

Forum » Integration » Pricing import/integration

Pricing import/integration

Rob van Brandenburg
Reply

I’m working on pricing integration from D365 F&O to DW10. I have it pretty much working, except for updates.
The full migration/integration is setup as a scheduled task, and has 5 sub tasks:

  1. Empty staging table
  2. Pull 'GROUP1' pricing from D365 into staging table
  3. Pull 'GROUP2' pricing from D365 into staging table
  4. Pull 'GROUP3' pricing from D365 into staging tableDyna
  5. Using a view on top of the staging table, the data is mapped to table EcomPrices, using the DynamicWeb provider.

The only box checked in the ‘Destination’ tab of the integration task for EcomPrices is ‘Create Missing groups’
The problem is that it does not update existing records, if I run the migration for a second time, it just doubles up the records in EcomPrices.

I want to do a full pull each time in case existing records in D365 are updated.
I was hoping that by setting multiple columns as ‘key’ columns it would interpret that as a combined key and use that to uniquely identify a record,
and as such it would update it.

Note that I need it to both update existing records AND add new records.

Any idea how I can achieve this?


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply
This post has been marked as an answer

Hi Rob,
you need to map the fields PriceId(accepts 255 chars) or PriceExternalId (accepts 250 chars) as a key columns in your column mappings and ensure the value that goes into that field is unique. Maybe you can combine several columns into the value of this field using the other columns data and a @Code script type? For example: 

@Code(data["PriceId"]?.ToString() + "_" + data["PriceProductId"]?.ToString() + "_" +  data["PriceCurrency"]?.ToString())

BR, Dmitrij

Votes for this answer: 1
 
Rob van Brandenburg
Reply
This post has been marked as an answer

That did the trick! Thanks Dmitriy !

Votes for this answer: 1

 

You must be logged in to post in the forum