Search code examples
axaptadynamics-ax-2012x++dynamics-ax-2012-r2

How to get a list of all Display Methods in a table?


I need to get a list of all display methods in a table, and I can't seem to find anything about this on the web.

Anyone know how to do this?


Solution

  • On display methods displayType is set to DisplayFunctionType::Get.


    DictTable dt = new DictTable(tableNum(VendTable));
    DictMethod dm;
    DisplayFunctionType dft;
    DictType dEdt;
    
    int mtdCnt = dt.objectMethodCnt();
    int i;
    
    setPrefix(strFmt("Table: %1", dt.name()));
    for (i = 1; i <= mtdCnt; i++)
    {
        dm = dt.objectMethodObject(i);
        dft = dm.displayType();
    
        if (dft == DisplayFunctionType::Get)
        {
            dEdt = new DictType(dm.returnId());
    
            info(strFmt("Method: %1 (Label: %2)", dm.name(), dEdt.label()));
        }
    }