Skip to main content
swapnar6405
January 31, 2023
Question

How to compare a text field data with a recordType or readonly grid column data.

  • January 31, 2023
  • 3 replies
  • 0 views

Hi,

I have an interface where I am loading the data in a read only grid using a recordType and also I have a "ADD" button to provide a new item to add.

Now, when the user is trying to save a text fields data, I would like to compare text fields data with a recordType fields/columns..

Can someone advise on how to compare user enter data in a text field with a recordType or Read only grid column. If user is trying to enter same data, I would like to return a validation message.

Thanks.

3 replies

mikes0011
Brainy
January 31, 2023

This is a little vague, but in general, if you want to ensure a user is entering a unique value in a text field (compared to any prior values entered in the DB), then what you can do is query the DB table and filter on the value the user entered (presumably using the "=" operator for a relatively exact match), and show a validation error if there are any maches to the query.

The Expression Guru
swapnar6405
January 31, 2023

Could you please let me know if it possible to load entire data into a local variable and start comparing with the user entered data in the text fields, instead of going to database every time.

mikes0011
Brainy
January 31, 2023

i'd strongly recommend against that, unless the "entire data" you want to load into the local variable is very small (and will always be very small).  it's quite a bit easier to do a targeted query for comparidon at the time you need to do the validation.

The Expression Guru