Axapta: Find table by name in AOT
I would like to query the AO开发者_JS百科T 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.
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;
}
精彩评论