i have a date field in my form which is set as mandatory using property but only red line appears when i click any othedr place it does not show any error or warning message
*This post is locked for comments
Did you set it on the form control? It should be done on the table or form data source level.
Hi Palak,
In case it is an unbound control (as I understand from the title) , you have to write your own validation logic. The mandatory part will be checked upon saving a record for database fields.
i wrote this validation logic.
The field name is CopyOfdialogDateFrom which is a date field i have set its property as mandatory but as this field is not bound to any datasource the mandatory property is not working
this is my form, i have a requirement such that the date field should be mandatory.
If i click on find button without entering any value in the date field it should flash up with an error.
public boolean validateWrite(){ boolean ret; if (!CopyOfdialogDateFrom) { ret = checkFailed("field must be filled in"); } //ret = super();
return ret;}
You should add your validation logic on clicked() method of Find button.
void clicked() { super(); if (!CopyOfdialogDateFrom.valueStr()) { checkFailed("field must be filled in"); } else { //your code } }
So add this code to button click or to the function behind the button instead of validatewrite
thanks it worked
getting another issue as the field is mandatory and if i fill the field with some value and then clear it and then click on find it displays 2 error messages
1. the system's message
2. the message i printed via code
Just remove all your old validations regarding this field and put your validation only in the button click.
But what if i want the mandatory red line in that particular control??
Just set property Mandatory to true.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Community Member 4
Guy Terry 2 Moderator
Nayyar Siddiqi 2