最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

[转]Open the Listpage form from another form by passing parameter in AX 2012

AX 2012 William 2944浏览 0评论

In axapta 2012 all the common forms are listpage forms , In list page form we can’t override any method so any validation can be done through ListpageInteraction Class .
My intention is open the Listpage form from another form, so for that  we need to change the code in InitializeQuery  method of ListpageInteraction class.
1) Override the clicked method of menuitembutton of Calling form
ex:

FormRun formRun;

Args args = New Args();
 super()
args.name(EAMWorkRequestListPage);
args.parmEnum(EAMWorkstatus::WaitingForAuthorization);
formRun = ClassFactory.formRunclass(args);
formRun.init();
formRun.run();
formRun.wait()
2) Based on passing enumvalue the Listpage will be filtered by overriding the InitializeQuery method of ListpageInteraction class.
if(this.listPage().listPageArgs() && this.listPage().listPageArgs().enumParameter())
{
    status = this.listPage().listPageArgs().enumParameter();
    qbds = _query.dataSourceTable(tableNum(EAMWorkRequest));
    qbds.addRange(fieldNum(EAMWorkRequest,Status)).value(queryValue(status));
}

注意:PageList窗体中的MenuItemButton、Button控件只有当其“DisplayTarge”属性设置为“Client”时才能添加事件代码,但同时该按钮将无法部署并显示到EP页面。
原文地址(GFW):http://axhelpdesk.blogspot.com/2013/06/open-listpage-form-from-another-form-by.html

转载请注明:ww12345678 的部落格 | AX Helper » [转]Open the Listpage form from another form by passing parameter in AX 2012

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址