How to import DateTime using XMLPort

robertderoosrobertderoos Member Posts: 10
I have created a xmlport which import an order from a xml file. There is however a datetime field from which i want to extract the date for use as the orderdate, but when i try to import it in a datetime field i get an error "invalid date 2006-11-01T12:13:14".

How can i create a datetime?

Best regards,
Robert

Comments

  • ara3nara3n Member Posts: 9,257
    change the node to a text and in trigger Import::OnAfterAssignVariable for the text do string manipulation.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • fbfb Member Posts: 246
    See also the XMLport "Format/Evaluate" property.

    From the C/SIDE Reference Guide:
    If the XML document that you want to import contains data that corresponds to the standard C/SIDE data types, you should select C/SIDE Format/Evaluate (default value). The data will then be evaluated before being inserted into the database.

    On the other hand, if the XML document that you want to import contains data that uses the standard XML data types, you must use the XML Format/Evaluate setting. This will ensure that the data is evaluated and converted to the C/SIDE data types before being inserted into the database.

    However, if the data that you want to import does not follow either the Standard C/SIDE formats or the XML formats, you must import the data into a temporary table in text format. You can then use C/AL code to convert the data before inserting it into the database.
Sign In or Register to comment.