Open posted Ledger Journals(Expense Journal) from listpage in ax 2012
void clicked()
{
#define.NewButton('NewButton')
#define.AllOpenPostedButton('AllOpenPostedField')
FormRun formRun;
FormDataSource formDataSource;
QueryBuildDataSource queryBuildDataSource;
FormControl formControlPosted, formControlNew;
super();
formRun = new MenuFunction(menuitemDisplayStr(LedgerJournalTable),MenuItemType::Display).create();
formdatasource = formrun.datasource();
querybuilddatasource = formdatasource.query().datasourcetable(tablenum(ledgerjournaltable));
querybuilddatasource.addrange(fieldnum(ledgerjournaltable, ale_projid)).value(projtable.projid);
querybuilddatasource.addrange(fieldnum(ledgerjournaltable, Posted)).value(SysQuery::value(1));
formControlPosted = formRun.design().controlName(#AllOpenPostedButton);
formControlPosted.visible(false);
formControlNew = formRun.design().controlName(#NewButton);
formControlNew.visible(false);
formRun.run();
}
No comments:
Post a Comment