Tuesday, March 23, 2010

How to determine if a Table has data per company in Microsoft Dynamics Nav

In order to find out if table data of Table is per company we are going to use a special table called Object. First we make the declaration of the record





Next at C/AL we can do the following

recTable.RESET;
recTable.SETRANGE(Type, recTable.Type::TableData);
recTable.SETRANGE("Company Name", '');
recTable.SETRANGE(ID, DATABASE::"Item Ledger Entry");  // Here use table id witch you want to inspect

IF recTable.FINDFIRST THEN
  // Table has not data per company

1 comment:

  1. This method is no longer possible :-( Atleast not in NAV2018CU11. (Company Name is blank for all tables)

    Would also be great to find a way to determine if a table has TableType set to Normal or refers to an external table.

    ReplyDelete