moveFirst

Definition:

NDLDS<datasource name>.<dataset name>.moveFirst()

 

Description:

Make the first record in the specified Dataset the current record and bind it to the Elements on the form.

If you select MoveFirst as a predefined action in an Element's Event Property, all Elements on the form which have input mappings to the specified Dataset will also be updated with values in the new current record (see Code sample and Notes).

 

Parameters:

none

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

 

Returns:

nothing

 

Code Sample:

if(NDLDSMyDatasource.myDatasets.moveFirst()){

//update the elements with the values of the current record

NDLRuntime.refreshFormControlsFromDatasource("MyDatasource", "MyDataset");

}

 

Notes:

  • The code sample above shows the JavaScript statements which will appear in the custom JavaScript function generated by an Element's Event property when MoveFirst is the selected action and you then click the Convert to Custom JavaScript button within the Event Builder pop-up.

    If you are using moveFirst in your own custom JavaScript functions, you can update the values displayed in the Elements on the form by calling NDLRuntime.refeshFormControlsFromDatasource as shown in the code sample above.

  • When calling moveFirst, 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.

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

 

Using as Predefined Action in Event:

When assigned to an Event as a predefined action, this function doesn’t require any editing.

 

 


See also:

getTable

refreshFormControlsFromDatasource

moveNext

movePrevious

moveLast

Writing Scripts