Developer forum

Forum » Integration » Dynamicweb 10 – Change order XML date format from US/ISO to EU (NAV Live Integration via Codeunit)

Dynamicweb 10 – Change order XML date format from US/ISO to EU (NAV Live Integration via Codeunit)

Davy Capiau
Reply

Hi all,

We’re using Dynamicweb 10 with NAV live integration via a codeunit, and the order XML currently outputs dates in ISO format, for example:

<column columnName="OrderShippingDate">2026-01-04T00:00:00</column>

Is there a way to configure Dynamicweb so that these dates are formatted in EU style (e.g., dd-MM-yyyy) instead of the default ISO format? Or does this require a transformation or custom logic?

Alternativally it might be something in the NAV codeunit?


Replies

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

Hi Davy,
currently it is not possible to change the formatting of the dates for the request xmls in the Live integration settings.
But you can add this function into the NAV codeunit to parse the dates from Dynamicweb reqeust:

procedure TextToDate(StrDate: Text): Date;
    var
        date: Date;
    begin
        if (STRLEN(StrDate) > 1) and (STRLEN(DELCHR(StrDate, '=', '-')) >= 8) then begin
            StrDate := DELCHR(StrDate, '=', '-') + 'D';

            date := DMY2DATE(TextToInteger(COPYSTR(StrDate, 7, 2)),
                TextToInteger(COPYSTR(StrDate, 5, 2)),
                TextToInteger(COPYSTR(StrDate, 1, 4)));
        end;
        exit(date);
    end;

BR, Dmitrij

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Dmitriy, doesn't ToIntegrationString use the culture settings on the LI provider?

If that doesn't give you what you need Davy, you could also use the extensibility API with notification subscribers to alter the XML before it gets sent to the ERP. You can tap into Notifications.Order.OnAfterGenerateOrderXml which gives you a reference to the document which you can then manipulate.

Hope this helps,

Imar

 

Votes for this answer: 1
 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
yes, the problem is that the "Number format culture" option is only used for the numbers only,  maybe as a new feature this option can be used also for the DateTime fields as well but then we need to look if that will not break the existing solutions.
BR, Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Ah yes, now I see. I looked at IntegrationExtensions and saw the use of Helpers.GetCultureInfo, but missed that it was for numbers only. For dates it looks like this:

internal static string ToIntegrationString(this DateTime value)
{
    return value.ToString("s");
}

which wil indeed always give you the same format.

>>but then we need to look if that will not break the existing solutions.

Agreed. I think you'll need a new setting to opt-in to that behavior.

Imar

 

 
Jelle Deridder
Reply

 

 

We didn’t change the Live Integration XML output, but we fixed the Swift checkout templates, because the delivery date was being formatted in a locale-dependent way and could be interpreted as US later in the flow.

What we changed:

  • OrderDeliveryDate.cshtml: updated the Flatpickr setup so the customer always sees EU format (dd/MM/yyyy), while DW always posts/stores an unambiguous ISO value (yyyy-MM-dd) in EcomOrderShippingDate. We also removed the locale-dependent formatting (e.g. browser/OS based formatting) to avoid month/day swaps.

  • StepSummaryDeliveryDate.cshtml: forced the summary display to dd/MM/yyyy (instead of ToShortDateString() which can vary with server culture).

Result: no more confusion like 01/04 → 04/01, no more “empty” dates for day > 12 (e.g. 30/01), and the delivery date remains consistent across the whole checkout while LI XML can remain ISO.

Thanks again for the help and the explanations, much appreciated!

Jelle

 

 

You must be logged in to post in the forum