Ext.TableId()

Returns the numeric ID of the specified table.

Function Signature

 int Ext.TableId( tableName [, string nameType] )

Parameters

Parameter Type Description

tableName

Variant

Specifies a table display name or database name. If the optional nameType parameter is omitted or equals "database", the tableName parameter is taken as the table's database name, such as "UBG_ISSUES". If the nameType parameter equals "display", tableName is taken as the table's display name, such as "Issues". Use caution when using the display name because it can be changed in SBM Composer.

nameType

string

Behavior depends on the value:

  • "database": (default) The tableName value is taken as the TS_TABLES.TS_DBNAME of the table.
  • "display": The tableName value is taken as the TS_TABLES.TS_NAME of the table.
  • "project": The tableName value is taken as the TS_ID, internal name, or UUID, of a project. If a matching project is found, the corresponding table ID is returned.
  • "workflow": The tableName value is taken as the TS_ID, internal name, or UUID, of a workflow. If a matching workflow is found, the corresponding table ID is returned.

Return

Type Description

int

Returns the numeric ID of the specified table. If the table does not exist, returns zero.

Examples:

var myTableId = Ext.TableId(  "APP_WORKFLOW", "workflow"  ) );
var myTableId = Ext.TableId(  8, "workflow" ) );
var myTableId = Ext.TableId( "f4c6fa0d-5484-4dd3-b443-5363c4573a18", 
"project" ) );

Technical Details

SBM ModScript version: 11.3.

Notes

The nameType can be "project" or "workflow", which will look for the project or workflow by ID, Internal Name, or UUID, and return the related table id. This is useful when you are submitting to a project, because this value can be passed to CreateProjectBasedRecord() to create an item for the table that the project is related to.

Related Topics

Extension Functions