Delta Object

The Delta object contains information about a server side delta. A Delta is a structure that holds changes before sending them off to the server; it can hold multiple records and delay sending updates till the server is available again. The integer indexer for this object returns the individual DeltaChange Object instance. The Global Object's 'lda' object has a property called deltas that returns this object.

The code snippet below shows how the Delta object can be used:

log('Delta name: ' + delta.name);
log('Delta count: ' + delta.count);
for (i=0; i<delta.count; i++)
{
   if (delta[i].newValues['Name'] == '[new customer]')
   {
      delta[i].newValues['Name'] = delta[i].newValues['Name']+'(Need to change)';
      log('Field Name changed from: [new customer] to: '+delta[i].newValues['Name']);
   }
}

Properties

count

Returns the number of changes in the delta.

name

Contains the (table) name of this delta.

fieldCount

Contains the number of fields in this delta.

currentChangeID

Returns the current change ID. This is the value used when adding new changes.

isReduced

Returns true if this is a reduced delta. Otherwise returns false. Reduced deltas don't contain all the fields, only the changed ones.

Functions

addChange()

Returns a new DeltaChange Object associated with the delta.

reset()

Resets the active record cursor to the first record. Use the nextRow() function to return this record.

nextRow()

Returns the current record (or undefined) and moves the active record cursor to the next record.

removeUnnecessaryChanges()

Removes all delta changes with no changed values.

getField(fieldno)

Returns the DeltaField Object field information by index or name.

discard()

Discard this delta all together.