jeudi 30 décembre 2010

How to control "Some Controls" in a form depending on some values in the rows from X++

I would like to show how we can change the status, the property of any control that depends in some values of the fetched data from th DataSource

example:  
I want to disable BUTTON1 if the type of the record is "100"
























Here are the steps you need to follow :
  1. Make the button AutoDeclared:
  2. Overload the method “Active” from the datasource methods.
  3. Make your condition.
For example in the method Active of your DataSource you can write this code

public int active()
{
int ret;
 
ret = super();
 
if(Dimensions.DimensionCode==SysDimension::Purpose)
{
Button.enabled(true);
} 
else
{
Button.enabled(false);
}
 
return ret;
}

Happy Daxing !

Aucun commentaire:

Enregistrer un commentaire