5
Views
3
Comments
Creating the user defined error messages for unique attribute
Question
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?



image (9).png
2025-08-22 10-19-44
Pramod Jain
 
MVP
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-
UserImage.jpg
Sathish D
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?
 
2025-08-22 10-19-44
Pramod Jain
 
MVP
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-
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.