Solved

How to validate for existing entry

  • 4 October 2016
  • 3 replies
  • 27 views

Badge +2

I have a form with a smartbox SMO used in a claims process. How do I build in a validation in a text field to check whether the claim number you're trying to enter does not already exist in order to prevent duplicate from being captured in the db?

 

Thanks

Coenie

icon

Best answer by AhmadAbdullah 4 October 2016, 10:51

View original

3 replies

Userlevel 3
Badge +8

Dear ,

 

I used one way to achieve that ... is by checking the database records before submitting the value.

u have something like when a button is clicked , then save the data into data base ... u will need to perform 1 rule before that which is checking the database records filtering them by the value u have in the textbox , and return the ID into a textbox .

in steps :

 

1-add "execute smartobject method (get list)" before ur saving rule 

2-filter the results from the method by the value in textbox compared to the column in data base .

3-if the record was found in database , in return properties , return the ID into a hidden datalabel in ur form.

4-after that u need to add an advanced condition (if the hidden data label isnot null) then "stop rules executions" and maybe show the user something to know that this record alraedy exist in data base ..

 

Hope it helps!

Regards.

Badge +2

It makes sense and I will try it out. Thanks so much.

thanks man. that worked!

Reply