Wednesday, September 6, 2023

ax - How to call new form and modify its grid filter

Args    args;
FormRun formRun;
Query query;
My_VM_Resources table;
FormDataSource formDataSource = new FormDataSource();

super();

// call the new form 
args = new Args();
formRun = new menufunction( menuItemDisplayStr( WrkCtrCapRes ), 
                            MenuItemType::Display ).create( args );

formRun.init();
formDataSource = formRun.dataSource();
formRun.run();

table = My_VM_Resources_ds.cursor();
formDataSource.filter( fieldNum(WrkCtrCapRes, WrkCtrId), /*"5210*"*/table.my_resource_mask );
formRun.detach();

formRun.wait();