Lasso Soft Inc. > Home

[KeyField_Value]

After a database search is performed using a -Search, -FindAll, or -Random tag, [KeyField_Value] returns the value of the current key field. For FileMaker Pro databases, the [KeyField_Value] is the internal record ID value from the database. For MySQL databases, the [KeyField_Value] is equivalent to the tag [Field: (KeyField_Name)].

After an -Add database action, [KeyField_Value] returns an identifier for the record that was just added. For FileMaker Pro databases, this is the internal record ID value. For MySQL databases, this is the value of the auto increment field in the tables, usually the ID primary key field.

After an -Update or -Duplicate database action the [KeyField_Value] is only defined for FileMaker Pro databases. It will return the internal record ID value for the record that was just updated or duplicated.

After a -SQL database action in a MySQL data source the [KeyField_Value] depends on which action was performed. After an INSERT statement for example, the [KeyField_Value] can be used to fetch the value for the auto increment field in the record that was just added.

  • Syntax
  • Parameters
[KeyField_Value]
Optional Parameters
Encoding Keyword Specifies the encoding for the tag's return value. Tags are encoded using -EncodeHTML by default if their value is output on a format file. No encoding is applied to nested tags unless an explicity encoding keyword is specified. One of -EncodeBreak, -EncodeHTML, -EncodeNone, -EncodeRaw, -EncodeSmart, -EncodeStrictURL, -EncodeURL, -EncodeXML.
Examples

To return the key field value for a record which was added to a database:

Use the [KeyField_Value] tag. The following example adds a new record to the People table of the Contacts database and returns the value for the primary key value of the new record.

[Inline: -Add,
  -Database='Contacts',
  -Table='People',
  'First_Name'='Elizabeth',
  'Last_Name'='NewPerson']
  <br>The added record has primary key value [KeyField_Value]
[/Inline]
Result:
<br>The added record has primary key value 34.
Tag Link [KeyField_Value] Category Database
Type Substitution Data Source Any
Support Preferred Version 3.0
Output Type String or Integer Security None
Implementation LCAPI Sets Lasso 7.0, Lasso 6.0, Lasso 5.0,LDML3x

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft