Sunday, August 9, 2009

Select Table/Field/User/… (PickList)

Sometimes you want your user to select a sertain table/field/… When you want to program this selection all by yourself you have to make a table, override the lookup()-method, …

There is also a easy way to do this. You can use the pic**** methodes in the Global class:
pickclasses
pickdatamethord...etc

How do you use these classes (you can find this example in \Forms\DocuOptionTable\Designs\Design\[Tab:TableTab]\[TabPage:Overview]\[Grid:TableOverviewGrid]\StringEdit:DocuTableName\Methods\lookup):
void lookup()
{
tableId id;
;
id = pickTable();
if (! id)
return;
docuTable.DocuTableId = id;
docuTable_ds.refresh();
}

The result:
Table : Field:
When you want to create you own customized pick-dialog you can by entering the following code:

static void testPickList(Args _args)
{
Object formRun;
container con;
;
formRun = classfactory.createPicklist();
formRun.init();

//fill container con

formRun.choices(con); // you can add a secundary parameter wth the imiges
formRun.caption("TEST"); // Make label
formRun.run();
formRun.wait();
if (formRun.choice())
{
print formRun.choice();
}
pause;
}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...