Are you importing the string directly into a Date field/variable in Navision? If so you may want to import it into a string variable and then try to clean it up.
I find dates (unless stored in a region agnostic format say the ISO 8601 standard for date times) can cause some confusion during imports as the region settings from one computer to another may be slightly different and thus different date values produce different results.
I am getting xml and mapping it to xml port schema in my application. Then passing it to a codeunit based webserivice and that passes the xml to xmlport to import the data in.
Now if bring the dates as string in xml to code unit, then ill have to read the xml again in codeunit and then pass it xml port or shall i not validate date at all.
When i import the same xml from a text file, it gets imported without any issue.
Ok is there error when reading the date field into the XML Port or somewhere else in the process?
If it's output of a date field from Navision into XML it may be that you need to format the fiedl differently. Normally when dates are exported they are exported in string format however date elements really should be represented as a proper XML formatted date (i.e. follow ISO 8601 standard) - if you use Format type 9 in any calls to the format function (this goes for dates, decimals, etc.) then the format function returns an XML compliant version of data. This means that decimals don't have a thousands seperator, dates are in ISO format, etc.
in .net
1) Incoming data > transform it to target schema using xslt to input xml
2) pass input xml to code unit web service
3) call code unit passes input xml to xmlport to import the data
Here I get the date error. Date is as per format in database / system regional settings.
I tried different date formats but still it gives that error.
When i try reading the same xml from file (by saving input xml in a file) and pass it to xmlport through code unit, it works fine.
I dont why is it through the error when passing it through .net code
Nice to hear you solved your problem. Date formats and inconsistencies between systems and regional settings is a common annoyance and why I've started using the XML file format whenever possible as this can remove ambiguity.
Answers
I find dates (unless stored in a region agnostic format say the ISO 8601 standard for date times) can cause some confusion during imports as the region settings from one computer to another may be slightly different and thus different date values produce different results.
Epimatic Corp.
http://www.epimatic.com
I am getting xml and mapping it to xml port schema in my application. Then passing it to a codeunit based webserivice and that passes the xml to xmlport to import the data in.
Now if bring the dates as string in xml to code unit, then ill have to read the xml again in codeunit and then pass it xml port or shall i not validate date at all.
When i import the same xml from a text file, it gets imported without any issue.
please advise?
regards,
If it's output of a date field from Navision into XML it may be that you need to format the fiedl differently. Normally when dates are exported they are exported in string format however date elements really should be represented as a proper XML formatted date (i.e. follow ISO 8601 standard) - if you use Format type 9 in any calls to the format function (this goes for dates, decimals, etc.) then the format function returns an XML compliant version of data. This means that decimals don't have a thousands seperator, dates are in ISO format, etc.
Epimatic Corp.
http://www.epimatic.com
in .net
1) Incoming data > transform it to target schema using xslt to input xml
2) pass input xml to code unit web service
3) call code unit passes input xml to xmlport to import the data
Here I get the date error. Date is as per format in database / system regional settings.
I tried different date formats but still it gives that error.
When i try reading the same xml from file (by saving input xml in a file) and pass it to xmlport through code unit, it works fine.
I dont why is it through the error when passing it through .net code
Any advice will help.
regards,
my mistake.
regards,
Good luck.
Epimatic Corp.
http://www.epimatic.com