createRecord

createRecord(options) ⇒ Promise

This is creating a Backbone model that represent Record.

Kind: global function
Returns: Promise - A promise that resolves to a related Backbone.Model
See: getRecord
Since: v0.0.1

Param Type Description
options
options.attributes Object The attributes for the record to be created.
options.moduleName string optional Default value is the current Module of the context. The moduleName to which record needs to be created.

Example

// Creates a record for the current Module.
 await createRecord({ attributes: { name: 'test', ...otherAttributes } });
 (or)
 // Creates a record the module name passed.
 await createRecord({ attributes: { name: 'test', ...otherAttributes }, moduleName: 'Accounts' });