Skip to main content

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(DASEmplDuplication), 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)

{

DASEmplDuplication DASEmplDuplication;

EmplTable localEmplTable;

;



    if(args.record().TableId == tablenum(EmplTable))

localEmplTable = args.record();

    ...

}