createDataSourceForFields

Creates a new DataSource instance on the client that can be used to load or save records from specified table and fields.

Parameters:

  • config (object): specifies data source configuration. Should contain following configuration properties:
    • id (string): the new DataSource ID;
    • tableNames (array of strings): the list of data source table names. Must contain at least one table name. The first table in the list is the main table, other tables are standard tables.
    • fieldNames (array of strings): the list of fully qualified fields from main and standard tables.

Example:

var dsLease = new Ab.data.createDataSourceForFields({
id: 'lease_ds',
tableNames: ['ls'],
fieldNames: ['ls.ls_id', 'ls.cost_index']
});
var record = dsLease.getRecord(restriction);
record.setValue("ls.cost_index", lsCostIndex);
dsLease.saveRecord(record);