SBM ModScript Reference → Programming SBM ModScript → Object Types → VarRecord → VarRecord 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. 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.
// Create and retrieve Contact record var myRecord = Ext.CreateAppRecord (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.GetFieldValue ( "EMAIL" ); if ( value == "" ) { ok = myRecord.SetFieldValue ( "EMAIL", "joe@company.com" ); } } if ( !ok ) { Ext.LogErrorMsg ("Error in Joe's Email field"); }
Only use this version of GetFieldValue if you are sure that the field will be found.
Also see VarRecord GetFieldValue() Method.
Copyright © 2007–2018 Serena Software, Inc., a Micro Focus company. All rights reserved.