How to convert a date to another format within a record?

Certified Associate Developer

I am trying to change the date format of all values of a colum, and I do not understand the error message I am receiving:

a!gridColumn(
  label: "Deadline",
  sortField: 'recordType!{foo299792458}Step.fields.{timeGoal}timeGoal',
  value: a!richTextDisplayField(
    value: {
      a!richTextItem(
        text: {
          text(fv!row['recordType!{foo299792458}Step.fields.{timeGoal}timeGoal'],"yyyy/MM/dd")
        },
        color: if(fv!row['recordType!{foo299792458}Step.fields.{timeGoal}timeGoal']<now(),
        "#8b0000",                           /* red if deadline is past */
        "#056608"),
        style: {
          if(fv!row['recordType!{foo299792458}Step.fields.{timeGoal}timeGoal']<now(),
           "STRONG",                           /* bold if deadline is past */
           "PLAIN")
        }
      )
    }
  ),
  align: "END"
)

The error reads:

Error Evaluating UI Expression

Expression evaluation error at function a!gridField [line 27]: A grid component [label=“null”] has an invalid value for “columns”. A grid column [label=“Time Goal”] has encountered an error. Expression evaluation error at function 'text' [line 36]: A null parameter has been passed as parameter 1.

Line 36 is the text-property where I attempt to convert the corresponding field of the record to the appropriate date format.

My question: What do I have to take care of to change the date-format for a given grid column?

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data