How to validate if current row being entered in editable grid already exits in grid

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

Parents Reply
  • 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

Children
  • 0
    Certified Senior Developer
    in reply to Niharika
    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()