Hello All,
I have created form with two data sources. I have added one checkbox and textbox which refer the datasource1 (table name : MyTable1) and also added grid which refers to Datasource2 (table Name : MyTable2).
Then write the below code in the create method of datasource2 in the form :
public void create(boolean _append = false)
{
super(_append);
this.forceWrite(true);
}
Also added below code in the validatewrite method of datasource2 in the form :
public boolean validateWrite()
{
boolean ret;
ret = super();
if(MyTable.MyField == "")
{
info("Some validation message");
ret= false;
}
return ret;
}
My issue : When I create new record in grid and do not fill the required fields, then on closing of the form or clicking on the textbox in anywhere in the form, the validation message fires properly (Display validation message one time), but when I click on any checkbox in the form ,the validation message fires two times which should come only once.
I have verified in the call stack, the validatedwrite method gets called two times on clicking the checkbox.
Please see the below screen shots on clicking the checkbox :

Please see the below Screen shot of clicking on the close button :

Thanks in advance.