views:

181

answers:

1

I would like to query the AOT to see if a table name exists using X++. Can anyone point me in the right direction or provide some sample code for doing that?

If table exists with the name (str tableName) provided, return true; else, return false.

Thanks

+2  A: 

You can use the tableName2Id function. It will return 0 if the table name isn't valid.

boolean IsValidTable(str _tableName)
{
    return tableName2Id(_tableName)==0 ? false : true;
}
Jay Hofacker
Worked perfectly. Thanks!
Brad