Developer forum

Forum » Integration » Cached orders in integration

Cached orders in integration

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I am importing a track and trace code into a custom field on an order. I am using the DynamicWeb Provider because I need the "Update only existing records" feature. However, with this provider the order cache is not cleared meaning the new values don't show up in the frontend. If I use the Order Provider (which I assume does clear the cache) I don't have the option "Update only existing records".

What is the recommend approach for this?

Imar

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
maybe you can try the approach with making a scheduled tasks for that, so the first task will import the data using the Dynamicweb Provider with UpdateOnly option and then the second task that can run afterwards that will clear the cache using the Method addin like described here. The public method is called: Dynamicweb.Ecommerce.Services.Orders.ClearCache();.
The problem is that there is no option to "Update only existing records" in the OrderProvider.
BR, Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yes, I tried that, but it fails: https://doc.dynamicweb.com/forum?PID=1605&ThreadID=95921

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Ok, the problem is that there are several methods with the same name in that class.
Another way is to make a manual change of the job xml file (in DW9 as its only in api and no UI for that there).
So in the end of the <Job></job> xml you can add this xml to call the services api:
<job>
...... original job content here
  <serviceCacheSettings>
    <services>
      <service>Dynamicweb.Ecommerce.Orders.OrderService</service>
    </services>
  </serviceCacheSettings>
</job>
Can you try that way?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Oh, Ninja tricks! :-) Yes, that works; and it's also maintained when you edit the job. Nice!

 

You must be logged in to post in the forum