Formatting Date Variable

0
Hello,  I have created a variable which is the result of the date an item is shipped + the provided “Terms” such as Net 30, where we enter just an integer value of the number of days in which it should be paid.  I then update an object which is then used to be exported to JSON. I am attempting to format this variable to the date of ‘dd-MM-yy’ after the given calculation. How should I best go about adjusting the format? I have attempted to make adjustments without creating the variable and just entering the equation directly into the object “edit change item” details.  All the fields with the exception of the sales terms are Date & Time attributes. Thanks in advance. 
asked
1 answers
0

As stated in the documentation https://docs.mendix.com/refguide/parse-and-format-date-function-calls#3-formatdatetime-utc the formatdatetime function returns a string.

In the change object you are therefore trying to set a string in a datetime attribute, resulting in the described error.

To solve this issue with the export to JSON create an alternative duedate attribute of type string and set the result from the format function in this new attribute and use this in the export mapping to create the correct JSON.

answered