Expression produces error "An implicit conversion of "DatePart("month", datefield)" from number to text exists. Insert an explicit call to ToString to make the conversion clearer."

Version 1

    Details

    Inserting a date field into a text field via an expression is producing an error.  "An implicit conversion of "DatePart("month", datefield)" from number to text exists. Insert an explicit call to ToString to make the conversion clearer."  Current expression: $(ProfileFullName + " departed the company on  " + DatePart("month",  CreatedDateTime) + "/" + DatePart("day",  CreatedDateTime) + "/" + DatePart("year",  CreatedDateTime))


    Resolution

     

    This happens when you attempt to insert a value from a field which is not a text field, into a text field. The field must be converted to a string. In earlier versions of the product this conversion was implicit but may not have behaved as expected. In later versions we require the explicit conversion to prevent issues. Also, as of 2015.1, the DatePart has been deprecated. Please see below:

    $(ProfileFullName  + " departed the company on " + ToString(LocalMonth(CreatedDateTime)) + "/" +
      ToString(LocalDay(CreatedDateTime)) + "/" +   ToString(LocalYear(CreatedDateTime)))