What format does the Date() function expect?

 

I'm seeing the below error in my client's log file.


01/05/16 18:46:01 [1936][1][FATAL] Exception evaluating expression in SetValueAction, date(toString(concat(subStr(toString($last_inspection_date_calc_c),6,2),"/",subStr(toString($last_inspection_date_calc_c),4,2),"/",subStr(toString($last_inspection_date_calc_c),0,4)))) : attempt to convert invalid value to date: 11/12/2015

I'm not 100% sure, but it seems to be only occuring for some users.  Does the function perhaps expect me to provide the date in a format that matches each users date format preferences?

The formula is within a calculated field.

Thanks in advance

Parents
  • SugarCRM uses the format

    2015-12-31 10:00:00 format by default.

    It automatically converts according to user preferences.

    When you do any kind of coding then you have to use as given above.

  • Thanks for your input, but I've done some further testing and I'm observing contradictory behaviour when testing the software's behaviour.

    The date() functions behaviour is demonstrating that it expects a format that matches the user's date format preference.  During Mass Updates, it is demonstrating that it expects the format 2015-12-31.

    So if I want it to work, I need to ensure that each users date preference matches what Sugare requires during Mass Updates, and have a matching formula within this field

    i.e. date(toString(concat(subStr(toString($last_inspection_date_calc_c),0,4),"-",subStr(toString($last_inspection_date_calc_c),4,2),"-",subStr(toString($last_inspection_date_calc_c),6,2))))

Reply
  • Thanks for your input, but I've done some further testing and I'm observing contradictory behaviour when testing the software's behaviour.

    The date() functions behaviour is demonstrating that it expects a format that matches the user's date format preference.  During Mass Updates, it is demonstrating that it expects the format 2015-12-31.

    So if I want it to work, I need to ensure that each users date preference matches what Sugare requires during Mass Updates, and have a matching formula within this field

    i.e. date(toString(concat(subStr(toString($last_inspection_date_calc_c),0,4),"-",subStr(toString($last_inspection_date_calc_c),4,2),"-",subStr(toString($last_inspection_date_calc_c),6,2))))

Children
No Data