control.addRecordToPosition()
- Last UpdatedJun 25, 2024
- 1 minute read
The addRecordToPosition() method to add a record at a specific position on the Base Form.
Syntax
// B1 is a Base Form object.
B1.addRecordToPosition(index);
or
B1.addRecordToPosition(index,object);
Parameters
|
Parameter |
Description |
|---|---|
|
index |
Specifies the position of the object to be added. |
|
object |
Record to add. This parameter is optional. |
Return Value
This method returns the new record added.
Example
// Define a record to add.
var dataObj = { Name:"Kevin",Address:"Park Street 1" };
// Define a Base Form object.
var B1 = control.findById("B1");
// Add the record to a position on the Base Form.
B1.addRecordToPosition(2,dataObj);
// or B1.addRecordToPosition(2);
Note: If you use this method to add a record using scripts for the On Record Add property of the Base Form, then at run-time a recursive loop will cause the browser to stop responding.