How do I make a specific field are mandatory?

I have 2 forms and that are different data sources
My requirement is table1 have check box, if I put that one as yes than automatically other form fields are mandatory

Override the validateWrite() method, check the check box value - if yes, and your fields are empty then return checkFailed.

That means insertion of the record will happen only after the required field are filled properly.

You can find this type of handling in case of standard forms even…

Hi kranthi nee kosame wait chestunna,

2 forms tesukoni different tables kada

if check box is yes then other form only fields are mandatory other wise no

its not for check fields that are must

Do you have relation between those 2 data sources?

If you have relation, then find the related record from the table

if (table.checkbox && !othertable.field)

ret = checkfailed(“the field must be filled”);

which will makes the field mandatory.

field oktai common ga undi kranthi

if(table1.checkbox == Noyes::Yes)

{

if(table2.field == table2.field)

{

table2_ds.object(fieldnum(table2,field1)).mandatory(true);

table2_ds.object(fieldnum(table2,field2)).mandatory(true);

}

}

i have 2 forms above code i wrote in form 2

in first form i have checkbox and field are in form2

one common field is there

thats y i wrote if(table2.field == table1.field)

if(table1.checkbox == Noyes::Yes)

{

if(table2.field == table1.field)

{

table2_ds.object(fieldnum(table2,field1)).mandatory(true);

table2_ds.object(fieldnum(table2,field2)).mandatory(true);

}

}