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

Customization in Dynamics 365 for operation (Dynamics AX, AX 7) – Part 8 Tree Control

网络文摘 alirazazaidi 3130浏览 0评论

Recently I complete the custom Inquiry for Dynamics Ax 2012 R3. That customization is extensive and based on Tree control. Now I did experiment with Tree view control  in Dynamics 365 for operation and output will share here.  For this post I used Dynamics 365 for Operation Update 4 Vm with contoso data.

Suppose we need to build tree Where Sale order Number came as parent and Customer account is as its child node. There is thousand possibilities, but I use simplest way. So first step to add form. Then add tree control it. Set Form Name and Auto declaration property to true. So we can access control in code behind.

 

Next step is to insert following code snippet initial method.

 

 

public class frmTreeViewTest extends FormRun

{

/// <summary>

///

/// </summary>

public void init()

{

SalesTable _Table;

TreeItemIdx _TreeItemid;

 

 

super();

 

MyTreeView.deleteAll();

MyTreeView.lock();

while select * from _Table

{

// _TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, _Table.SalesId + " : " + _Table.CustAccount ,FormTreeAdd::Root,  _Table.RecId);

 

_TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, "Sales Order :" + _Table.SalesId ,FormTreeAdd::Root,  _Table.RecId);

SysFormTreeControl::addTreeItem(MyTreeView, " Customer Account : " + _Table.CustAccount ,_TreeItemid ,  _Table.RecId);

 

SysFormTreeControl::expandTree(MyTreeView,_TreeItemid);

 

 

 

}

}

 

}

 

Its works for me.

 

 

 

For rest Limit is only sky. Happy development.

发表我的评论
取消评论

表情

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

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