SBM ModScript Reference → Programming SBM ModScript → Object Types → AppRecord → AppRecord GetFieldValue-type-() Method
Gets the value of a field in the calling record's variable field list.
string GetFieldValueString( name ) int GetFieldValueInt( name ) int64_t GetFieldValueInt64( name ) double GetFieldValueDouble( name ) TimeT GetFieldValueTimeT( name ) Variant GetFieldValue( name )
Parameter | Type | Description |
---|---|---|
name |
string |
The name of the field whose value will be retrieved from the calling record's variable field list or the AppRecord column. Field names for variable fields should be provided in upper case for database names (TITLE, for example) or in lower/mixed-case for display names (Title, for example). For details on working with different types of database fields, refer to Working with SBM Database Fields. |
Type | Description |
---|---|
string int int64_t double TimeT Variant |
The internal value for the field. For Text fields, this is the exact value entered in the field. |
SBM ModScript version: 11.3.
Signatures where return is not Variant were added in 11.4 and moved from VarRecord to AppRecord in 11.6.
Example with AppRecord:
//Create and retrieve Project record var tableId = Ext.TableId("TS_PROJECTS"); var myRecord = Ext.CreateAppRecord(tableId); var ok = myRecord.Read("Image Builder"); if ( ok != 0 ) { var value = myRecord.GetFieldValueInt( "parentid" ); Ext.LogInfoMsg ("Parent ID of Image Builder is " &&& value); }
Example with VarRecord:
// Create and retrieve Contact record var myRecord = Ext.CreateVarRecord (Ext.TableId ("TS_CONTACTS")); var ok = myRecord.ReadWithWhere ("TS_CONTACTFIRSTNAME like 'Joe'"); // If no e-mail address, supply default value if ( ok ) { var value = myRecord.GetFieldValueString( "EMAIL" ); if ( value == "" ) { ok = myRecord.SetFieldValue ( "EMAIL", "joe@company.com" ); } } if ( !ok ) { Ext.LogErrorMsg ("Error in Joe's Email field"); }
Also see AppRecord GetFieldValue() Method.
Copyright © 2007–2019 Micro Focus or one of its affiliates. All rights reserved.