Suppose you have a Form and you want to call another form passing some filters.

Go to Clicked() method of the “ViewSource” button and insert this code

void clicked()
{
Args args = new Args();
str menuItemDisplay = MenuItemDisplayStr(ERAInventJournalTable);
MenuFunction MenuFunction = new MenuFunction(menuItemDisplay, MenuItemType::Display);
Query q = new Query();
QueryBuildDataSource qbds = q.addDataSource(tableNum(InventJournalTable));
QBDS.addRange(fieldNum(InventJournalTable,JournalId)).value(ERAStageExtWhsInvrptbal.JournalNameId);
args.initialQuery(InitialQueryParameter::createByQuery(q));
args.caller(element);
MenuFunction.run(args);
}
