Creating the user defined error messages for unique attribute

Creating the user defined error messages for unique attribute

  
Hi, How do I set the validation message for the unique attribute  voilation?

I have BillNumber attribute in my database Purchase. It has to be unique so It set it so in index.
But I couldn't set my own validation message for it.

What do I give in the If statement to detect the billnumber attribute is voilated?


Hi Satish,
For controls you can set Valid and Validation message to what ever you want , other than this you can show your customized message any time by using Feedback message based on some condition.

Regards
-PJ-
Pramod Jain wrote:
Hi Satish,
For controls you can set Valid and Validation message to what ever you want , other than this you can show your customized message any time by using Feedback message based on some condition.

Regards
-PJ-
But how do I check the unique attribute is violated ? I tried get purchase.list.empty as the image above. What should I give in the condition? For checking the bill number entered in the form and database are same?
 
Hi Satish, You can run a query and check if the bill number is already exists or not. Like: Select * from entity where billnumber=@billnumber If it returns empty list than bill number doesnt exists. Regards -PJ-