Developer forum

Forum » Integration » Exclude fields from order XML before passing it on to NAV

Exclude fields from order XML before passing it on to NAV

Roald Haahr
Reply

Hi,

Using DW 9.10.16 I need to exclude OrderCurrencyCode from the generated XML before sending it to NAV. Is that possible?

Kind regards,
Roald


Replies

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

Hi Roald,
Yes, but you need to use the Live Integration extensibility api:
In Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Notifications.Order.OnBeforeGenerateOrderXml
you can remove the Order currency code: order.CurrencyCode = null
(remember to cache the previous value of the order Currency Code to some Session/Request Items variable)
and then
In Dynamicweb.Ecommerce.DynamicwebLiveIntegration.Notifications.Order.OnAfterGenerateOrderXml
restore the previous value:
order.CurrencyCode = currencyCodeFromCache;

BR, Dmitrij

Votes for this answer: 1
 
Roald Haahr
Reply

Hi Dmitrij,

I implemented your suggestion and it would return an error whenever I triggered a calculation of the basket. It seems like there is some logic stating that currency code cannot be null. However, setting currency code to an empty string instead did the trick. Thank you for your help :)

Kind regards,
Roald

 

You must be logged in to post in the forum