Hi ,
Can anyone please help me with this issue! Thanks for the help in advance.
I have an interface , i have used a!gridfield(). In the grid of the column is the date received. The error says that at function a!gridfield cannot apply operator[LESS THAN] to field [Daterecieved] when comparing to value [TypedValue[it=7,v=2024-09 -27]
a!gridColumn( label: "Average customer rating", backgroundColor: a!match( value: tointeger(today()-todate("9/11/2024 12:00 AM")) whenTrue: fv!row < 10, then: "NEGATIVE", whenTrue: fv!row > 20, then: "SUCCESS" default: "NONE"),Here in above value: I am calling fv!row[recordtype!abc,daterecieved] , above is just a single value.
Thanks for your responses . But Sorry my bad , its actually fv!value which i have given.
Below is the code:
a!gridField(label:"Rating Grid",data:local!data,columns:{a!gridColumn(
label: "Average customer rating",sortField: recordType!rating.datarecieved],value:a!tagField(label:"tags",tags: a!TagItem(text:tointeger ( today() -todate(fv!row[recordtype!ratings.daterecieved])),
backgroundColor: a!match( value: tointeger(today()-todate(fv!row[recordtype!ratings.daterecieved]),whenTrue: fv!value < 10,then: "NEGATIVE",whenTrue: fv!value > 20,then: "SUCCESS" ,default: "NONE"
),},)
So basically , I am getting the data from expression rule saving it in the local variable and then using it . So here , based on the date received i am calculating how many days it is and based on that i am showing the background color. But when i am trying to , its throwing me the error : Cannot apply operator ( As shown above )
Discussion posts and replies are publicly visible
vyshnavig0001 said:todate(fv!row[recordtype!ratings.daterecieved]))
Why are you wrapping fv!row[...dateReceived] in todate()? Wouldn't the row's dateReceived column already be a date type? Or does it actually contain text that can be safely passed into the toDate() rule?
I am using it coz : For eg : Date received " 9/11/2024 12:00 AM GMT" is one sample data . So here i am trying todate to get date i,e -- 9/11/2024 . I am doing today()- todate(" 9/11/2024 12:00 AM ") where we get 19::00:00:00.000 . Now i want only number so i am using to integer. So i am doing tointeger(today()-todate("9/11/2024 12:00AM")) .... I am doing it coz i can compare based on whether i get output > 10 or < 10 i show different colors as background.
Can you try adddays("YOURDATE",10)>now() and adddays(now(),-10)<today() .That should help you compare the values.
Hi , Thanks for your response .
But its not working . I mean the function is not available
This function might be part of a plugin.
You can use networkdays( date( 2024, 10, 20 ), today()) which can return same result for you