FM.baseTable ( )

Function stats

Average user rating
37
328
9999
Support
FileMaker 10.0 +
Date posted
05 April 2012
Version
1
Recursive function
No

Author Info
 Fabrice

74 functions

Average Rating 4.4

author_avatar



 

Function overview

Prototype

FM.baseTable  ( _tableName )


Parameters

_tableName  can be a table name, a table ID, or a full field name


Description

Tags:  table   sql   dev   Design  

Design function.
Returns the base table name of a table occurrence

Parameter : can be a table name, a table ID, or a full field name

FileMaker 12 required.

Examples

Sample input

FM.baseTable ( getfieldname ( my_Contacts_TO::myField ))


Sample output

Contacts (the base table name)

 

Function code

/* FM.basetable ( _tableName )

by Fabrice Nordmann, 1-more-thing

http://www.1-more-thing.com
http://www.twitter.com/1morethingtweet


Design function.
Returns the base table name of a table occurrence

Parameter : can be a table name, a table ID, or a full field name

FileMaker 12 required.

v1 - Apr 2012
*/

Let ([
    _tableName = _tableName ; // so you can easily copy to dataviewer or calculation box
    _tableName = GetValue ( Substitute ( _tableName ; "::" ; ¶ ) ; 1 ) ;
    _tableName = Substitute ( FilterValues ( TableNames ( Get ( FileName )) ; _tableName ) ; ¶ ; "" ) ; //to adjust the case
    _info = Case ( Filter ( _tableName ; 1234567890 ) = _tableName ;
        ExecuteSQL ("SELECT BaseTableName FROM FileMaker_Tables WHERE TableID='" & _tableName & "'" ; ¶ ; "" ) ; // match by ID
        ExecuteSQL ("SELECT BaseTableName FROM FileMaker_Tables WHERE TableName='" & _tableName & "'" ; ¶ ; "" ) // match by Name
        )
];

_info
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/328

    Prototype: FM.baseTable( _tableName )
    Function Author: Fabrice (http://www.fmfunctions.com/mid/37)
    Last updated: 05 April 2012
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)