How to find if a table is mapped in a map?

Sometimes we would like to know if a particular table is mapped in a map. To achieve this, SysDictTable::isTableMapped() method can be used. This method takes two parameters, the map name and the table which we want to check if it is mapped.

SysDictTable::isTableMapped(tablenum(AddressMap), tablenum(LedgerTable));
SysDictTable::isTableMapped(tablenum(AddressMap), tablenum(CustTable));

The first statement will return false since LedgerTable does not have a mapping in AddressMap map. The second statement will return true since the CustTable fields have a mapping in the AddressMap map.

Note how the tablenum() function can also be used to return the id of a map.


Popular posts from this blog

How to add empty ranges in query

Get selected records in Dynamics AX 2012

How to refer to form controls in code without setting the AutoDeclaration property in Dynamics AX?