how to make a field mandatory in Table D365
*** To make a field mandatory in a Table we have to override validateWrite() method
Example:
public boolean validateWrite()
{
boolean ret;
if (!this.Dept_Name)
ret = checkfailed("Dept Name must be filled");
return ret;
}
*** To make a field mandatory in a Datasource we have to use ValidateWrite method on the DataSource of the table.
public boolean validateWrite()
{
boolean ret1;
ret1= next validateWrite();
if (!this.InventSiteId )
{
ret1 = checkfailed("Site must be filled");
}
else if (!this.InventLocationId )
{
ret1 = checkfailed("Warehouse must be filled");
}
return ret1;
}
Comments
Post a Comment