I want to validate if current row being entered in editable grid is duplicate or not i.e. does it exists in grid already or not.
Discussion posts and replies are publicly visible
How you differentiating rows? Any unique fields. We got many ways of comparing arrays for example Contains().
if you're talking about a new row that the user adds, basically you'd have to implement some validation that checks every column value in that row with every column value from prior rows, and determine if all values match the values from some prior row. this would need to be done manually, but it shouldn't be that difficult.
I tried using whereContains() but it is giving me error,
Expression evaluation error at function 'wherecontains' [line 273]: Invalid types, can only act on data of the same type (Text, Number (Integer))
My line of code is this
count(wherecontains(fv!item['recordType!SMA StudentMarksData.fields.computer'], local!DB.data['recordType!SMA StudentMarksData.fields.computer']) )>0
what do you mean by manually?
you'd have to manually build the logic to do the comparisons between a new row and existing rows, and use it for on-form validation.
Niharika said:can only act on data of the same type (Text, Number (Integer))
Approach is almost good but you lost it in transition .
Isn't this error saying it clearly. Your trying to compare Invalid types. What you are entering in the grid is a text value but what you are getting from Backend to compare is Integer so look into it how data structured in DB and how you are entering it .
Or On grid if you are capturing integer value in a text field try wrapping it with tointeger()