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:
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
The error message is about one of your date values being NULL. The function text() is not null-save.You might want to add a null check.
Good point, I fully forgot about my NULL values. So you are suggesting to do the if() around my conversion, correct?
Yes. I typically create a set of "Display-Rules", simple expressions which I use to display a technical value to the user. These expressions must be implemented in a null-save way.