Validation on multiple fields

Certified Senior Developer

I have an editable grid containing two drop-down columns with other editable columns as well.

In grid, one drop-down value is mapped with another drop-down value. I need to put a validation that if that particular mapping already exists in DB then show mapping already exists only on click of submit button.

Let's say in DB values in one row are:

A (drop-down 1)    B (drop-down 2)       C (Text field)

              1                             2                            xyz

       

Then if user enters the same mapping of A and B, i.e. selects A as 1 and B as 2 in UI, then show mapping exists.

User can add multiple rows in editable grid through add row button and multiple mappings in grid can be added. It should be able to check for all rows and throw validation on row components where duplicate exists in DB.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    You can use validationGroup to run the validation only on the button click and to validate you can query the data into one variable and insert the grid data into seperate variable and there you can put your logic to check whether the data is available into DB or not.

  • 0
    Certified Senior Developer
    in reply to Deepak gupta

    When should I fetch the data from DB to compare with grid data, is it on click of submit or at form load.

    There are multiple users who can create a mapping request. Let's suppose one user trying to create a mapping but before he submits that mapping, another user already submitted the same and now when first user started the mapping the mapping was not in DB but now when he clicks on submit it is there because another user submitted the same before him.

    How do you handle this concurrency situation.

    Another question, I am unable to use validation group. Can you help with the logic. When I call the validation in validations parameter, then it checks before submit or in parallel to user entry.

Reply
  • 0
    Certified Senior Developer
    in reply to Deepak gupta

    When should I fetch the data from DB to compare with grid data, is it on click of submit or at form load.

    There are multiple users who can create a mapping request. Let's suppose one user trying to create a mapping but before he submits that mapping, another user already submitted the same and now when first user started the mapping the mapping was not in DB but now when he clicks on submit it is there because another user submitted the same before him.

    How do you handle this concurrency situation.

    Another question, I am unable to use validation group. Can you help with the logic. When I call the validation in validations parameter, then it checks before submit or in parallel to user entry.

Children