Skip to content

How to show all display methods

By using a simple X++ job you can find easily all the display method on the table level.

private void ShowDisplayMethod()
{
   SysDictTable            sysDictTable = new 
   SysDictTable(tableId);
   DictMethod              dictMethod;
   DictType                dictType;
   int                     i;
   if (sysDictTable)
   {
       for (i = 1; i <= sysDictTable.objectMethodCnt(); i++)
       {
           dictMethod = sysDictTable.objectMethodObject(i);
           if (dictMethod
           && (dictMethod.displayType() == DisplayFunctionType::Get ||
               dictMethod.displayType() == DisplayFunctionType::Set))
           {
               dictType = new DictType(dictMethod.returnId());
               if (dictType
               && (dictType.baseType() == Types::String  ||
                   dictType.baseType() == Types::Integer ||
                   dictType.baseType() == Types::Real    ||
                   dictType.baseType() == Types::Date    ||
                   dictType.baseType() == Types::Enum))
               {
                   MethodList.add(dictMethod.name());
                   methodCon += [dictMethod.name()];
               }
           }
       }
   }
}

Published inTechnical Blog