Developer forum

Forum » Integration » Download Current XML on order in backend not picking up settings fields

Download Current XML on order in backend not picking up settings fields

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

When downloading the Current XML for an order from the backend, the result is different from the standard order XML. I think it's because of this code:

private void GetCurrentXml(Settings settings)
{
    Order order = (Order)Ribbon.DataContext.DataSource;
    var logger = new Logger(settings);
    string xml = new OrderXmlGenerator().GenerateOrderXml(settings, order, new OrderXmlGeneratorSettings
    {
       AddOrderFieldsToRequest = true,
       AddOrderLineFieldsToRequest = true,
       CreateOrder = true,
       Beautify = true,
       LiveIntegrationSubmitType = SubmitType.DownloadedFromBackEnd, ReferenceName = "OrdersPut"
    }, logger);
    StreamFile(xml, $"Order_{order.Id}.xml");
}

This code is not setting all properies of OrderXmlGeneratorSettings which GenerateOrderXml needs. It's missing at least these:

  • ErpControlsDiscount
  • ErpControlsShipping
  • ErpShippingItemType
  • ErpShippingItemKey
  • CalculateOrderUsingProductNumber

Without these, the way shiping and discounts are generated is different (for example, ErpShippingItemKey is not added to the order XML).

Can this be fixed in LI? Maybe BuildOrderXml should gets its data from the currentSettings parameter instead of the settings parameter (which is the partially populated OrderXmlGeneratorSettings instance)?

Thanks!

Imar

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

9 or 10 or both?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

9 for now. I don't think 10 has the option to download from the backend, does it?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
you are right, some settings are missed, this is a bug and will be fixed just for DW9 as we don't have that RibbonBar add-ins stuff in DW10.
BR, Dmitrij

 
Rasmus Sanggaard Dynamicweb Employee
Rasmus Sanggaard
Reply

Hi Imar,

 

What is the use case you are trying to achieve?

 

BR Rasmus Sanggaard

 

 

You must be logged in to post in the forum