jeudi 19 janvier 2012

Passing values between form and class

Class name is EmplDuplication and Form is EmplTable.
void clicked()
{
   MenuFunction mf;
   args args = new Args();
   ;

    args.record(EmplTable);

    mf = new menufunction(identifierstr(EmplDuplication), MenuItemType::Action);
mf.run(args);
}

Meanwhile, in the main() method of the EmplDuplication class, we need to put this Axapta x++ code to get the datasource:

static void main(Args args)
{
    EmplDuplication EmplDuplication;
EmplTable localEmplTable;
;

    if(args.record().TableId == tablenum(EmplTable))
localEmplTable = args.record();
    ...
}

Aucun commentaire:

Enregistrer un commentaire