0

Please how to show icons on FormTreeControl in Dynamics 365 For Finance and Operations

Icons in Tree Control in Dynamics AX 2012

Here is my actual code, using to show icons in D365FO, #ResAppl Macro

public class IconsTree extends FormRun {

public void init()
{
    SalesTable _Table;
    TreeItemIdx _TreeItemid;

    super();

    MyTreeView.deleteAll(); //This is my Tree Control on Form
    MyTreeView.lock();

    ImageListAppl dd = new ImageListAppl();
    ImageRes imageRes = dd.image(#ImageFormButtonGroup);

    MyTreeView.setImagelist(dd.imageList());



    while select * from _Table
    {

        _TreeItemid = SysFormTreeControl::addTreeItem(MyTreeView, "Sales Order :" + _Table.SalesId ,FormTreeAdd::Root,  _Table.RecId, #ImageOverlayYellowLock);
        SysFormTreeControl::addTreeItem(MyTreeView, " Customer Account : " + _Table.CustAccount ,_TreeItemid ,  _Table.RecId);
        SysFormTreeControl::expandTree(MyTreeView,_TreeItemid);
        SysFormTreeControl::setOverlayImage(MyTreeView, _TreeItemid, imageRes);
    }
}

}

and the result , no icons :

enter image description here

Adnane
  • 21
  • 6

1 Answers1

2

From what I have understood and what Microsoft indicates it's not allowed use image or icons on tree control in D365FO.

What is allowed build extensible controls, check this link Check box support in tree controls

Alex Kwitny
  • 11,211
  • 2
  • 49
  • 71
Jonathan Bravetti
  • 2,228
  • 2
  • 15
  • 29
  • Is there any alternatives to do that ? – Adnane Dec 12 '19 at 14:03
  • 2
    Making your own extensible control is the only option. You could build your own control based on https://www.jstree.com/ – Alex Kwitny Dec 12 '19 at 16:04
  • To add, every method you would expect is present on the tree control, so you would think it works...Microsoft just half-ported the `MorphX` control to the `React` framework. I spent way too many hours trying to get it to work in D365 as well before someone at Microsoft told me to make my own control. – Alex Kwitny Dec 17 '19 at 15:59