MMQuery_GetFieldTypes
- Description
This function returns either the Field Type of a specific Field or a List of "FieldName=FieldType" pairs for all Fields in a Table. The first parameter is the Name of a Table Occurrence of the Table to return the Field Types from. If you do not specify this parameter, MMQuery will use Get(LayoutTableName) to get the Current Layout TO to return the Field Types from. If you specify a Field Name in the second parameter, MMQuery will return the Field Type of that specific Field. If you do not specify this parameter, MMQuery will return a list of "FieldName=FieldType" pairs for all the Fields in the Table. By default, MMQuery will check to make sure the TO Name and the Field Name you specify exist before getting the Field Types. If you already know for sure that the TO Name and Field name exist, you can pass True as the third and fourth parameters.
Note: In FileMaker Pro 7 through 10, to ensure that you get the Field Types of all the Fields in your Table, you must make sure that there is not a Layout in your Database with the same name as the TO Name you specify for this function. In FileMaker Pro 11 and above, this is no longer an issue.- Return Type
- Text
- Format
- MMQuery_GetFieldTypes ( TOName ; FieldName ; SkipTONameCheck ; SkipFieldNameCheck )
- Optional Parameters
- TOName
The Name of a Table Occurrence of the Table that contains the Fields. Specify "" to use the Current Layout TO. In FileMaker Pro 11 and above, you can optionally specify the Database Filename (without the ".fp7" extension) containing the TO in the format "FileName.TOName".
- FieldName
If you specify this parameter, MMQuery will return the Field Type of the Field you specify. Otherwise, MMQuery will return all the Field Type of all the Fields.
- SkipTONameCheck
If True, MMQuery will not check to make sure the TO Name you specify actually exists.
- SkipFieldNameCheck
If True, MMQuery will not check to make sure the Field Name you specify actually exists.
- TOName
- Related Items
- MMQuery_AddField, MMQuery_FieldExists, MMQuery_GetFieldNames, MMQuery_GetFieldTypes, MMQuery_GetFieldValueByFind, MMQuery_GetFieldValueByID, MMQuery_RemoveField, MMQuery_SetFieldValueByFind, MMQuery_SetFieldValueByID
- Examples
Example 1
Code:
MMQuery_GetFieldTypes("MyTable")Result:
Returns something like:<br/>
AField=Text<br/>
BField=Calculation (Number)<br/>
CField=Global TimestampExample 2
Code:
MMQuery_GetFieldTypes("";"AField")Result:
Returns "Text" if the Field Type for the "AField" Field in the current Table is a Text Field.Example 3
Code:
MMQuery_GetFieldTypes("AnotherFile.MyTable")Result:
In FileMaker Pro 11 and above, use this form to get the Field Types of a Table in a separate, open Database file.