Data methods

getFieldValue

setFieldValue

getFieldValue

9.0

 

 

 

Get the value of the field as specified by the name parameter for this embedded file. When attempting to get a field value that is not defined in the collection schema, null is returned.

Parameters

name 

A string that identifies the field of interest.

includePrefix

(Optional) A Boolean value indicating whether the prefix should be included with the returned string. If true, the prefix is included with the return string. The default is false.

Returns

The value of the field, or null if field is not present in schema.

setFieldValue

 

9.0

 

 

 

Type conversion is performed when setting field values. The type conversion is determined by the collectionField in the schema. When attempting to set a field value that is not defined in the schema, an exception is raised.

Parameters

name 

A string that identifies the field of interest. An exception raised if name not present in schema.

value

A string, a number, or a date that specifies the value of the field. The value will be type-coerced to match the schema.

prefix

(Optional) A string that specifies the field value prefix.

Returns

The value of the field, or null if field is not present in schema.

Example

Get and set field values of the first data object in this collection.

var d = this.dataObjects[0];

d.setFieldValue("subject", "New laptop!", "RE: ");

 

// Now get the same field value we just set. Here s = "RE: New laptop!"

var s = d.getFieldValue({ name:"subject", includePrefix:true });

 

// Get the same field value, with includePrefix set to false, the default

// Now the value of s is "New laptop!".

s = d.getFieldValue("subject");

 

// Sets subject to "A. C. Robat" and clears prefix

d.setFieldValue("subject", "A. C. Robat");