findRecord

Definition:

NDLDS<datasource name>.<dataset name>.findRecord(searchObj)

 

Description:

Search for a record in the specified Dataset, based on its Primary Key value(s).

 

Parameters:

This function has one parameter:

searchObj - Required

An object containing a property for each of the Primary Key fields in the Dataset.

The properties must have the same names as the Dataset columns converted to a suitable format for use within JavaScript - any characters which are not A-Z, a-z, 0-9 or '_' should be replaced with '_', and the first character of the name should be converted to lower case. The Code Name column under the Datasource Mappings tab shows the name as it should be used here. The names are case-sensitive.

The property values must be set to the Primary Key values you want to match against.

Note: This function does not use the default ndlParams object.

 

Returns:

Object containing the entire record.

 

Code sample:

var searchObj = {givenName:"Susan", surname:"Smith"};

return NDLDSMyDatasource.myDatasets.findRecord(searchObj);

 

Notes:

  • The function will search for a record in the specified Dataset, whose Primary Key field(s) match(es) the value(s) in the supplied properties.

  • The found record is NOT made the current record nor is it bound to the Elements on the form.

  • When calling findRecord, you can find the names you need to use in your custom JavaScript to refer to a Datasource and its Dataset from the Datasource and Datasets's Code Name properties and for Dataset column names from the Code Name column under the Mappings tab when the dataset is open in the Form Design workspace.

  • findRecord is also available from a Dataset's table object, which can be obtained by calling getTable.

 

Using as Predefined Action in Event:

n/a

 

 


See also:

getTable

moveFirst

moveNext

movePrevious

moveLast

moveToIndex

moveToRecord

Writing Scripts