3

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?

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
Heygar
  • 553
  • 1
  • 7
  • 19

1 Answers1

5

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()));
    }
}
Matej
  • 7,517
  • 2
  • 36
  • 45
  • This works perfect. Do you also know how to get the labels from the EDT/Base enum that it returns? – Heygar Sep 17 '15 at 12:38
  • @Heygar use [`DictType.label`](https://msdn.microsoft.com/en-us/library/dicttype.label(AX.60).aspx). See updated example. – Matej Sep 17 '15 at 14:02
  • Amazing! I was so close myself, but this was much simpler and better. – Heygar Sep 17 '15 at 15:51