Application
Application¶
Abstract
Summary of the Application class
Class Description¶
The class represents an eLegere Application. The class offers methods to create, delete, and read rows both on master and detail tables. In order to create an application object, use either the getApplication or getApplicationFromToken functions, or the environment.getApplication or domain.getApplication methods.
Note
The class requires the initialization through the elegere object.
Methods¶
deleteMany Promise<SaveResult>
¶
1 |
|
deleteMany()
deletes multiple rows from an eLegere master table.
For Example:
1 |
|
Parameters¶
items
object[] Each object represents an eLegere Master row. Every object must contain a row Id and a TIMESTAMP field.
Return¶
A promise that returns SaveResult object.
deleteManyDetail Promise<SaveResult>
¶
1 |
|
deleteManyDetail()
deletes several rows from the Details of an Application. Each separate row of the detail constitutes an object.
1 |
|
Parameters¶
detailName
string detailName
defines the specific Detail Tab containing the rows.
details
object[] Each object represents an eLegere Detail row. Every object must contain Id and TIMESTAMP fields.
Return¶
A promise that returns SaveResult object.
deleteOne Promise<SaveResult>
¶
1 |
|
deleteOne()
deletes a single row from the eLegere Master table.
For Example:
1 |
|
Parameters¶
item
object The parameter defines the specific row Id and Timestamp.
Return¶
A promise that returns SaveResult object.
deleteOneDetail Promise<SaveResult>
¶
1 |
|
deleteOneDetail()
deletes a particular row of a Detail table in an Application.
For Example:
1 |
|
Parameters¶
detailName
string Defines the specific Detail Tab containing the rows.
detail
object Defines a JavaScript object identifying a single detail row. It must contain a row Id and a TIMESTAMP field.
Return¶
A promise that returns SaveResult object.
getDetails Promise<ReadResult>
¶
1 |
|
getDetails()
recovers a list containing one or more items from an Application's Detail table.
For Example:
1 2 3 4 5 6 7 8 |
|
Parameters¶
detailName
string detailName
defines the specific Detail Tab containing the rows.
filter
string The parameter is a OData filter for detailName
: it points the items to retrive from the Detail table. The parameter is optional.
filter: string
supports the following OData filters:
- eq
- ne
- gt
- ge
- lt
- le
- and
- or
- substringof
- dr (custom eLegere OData filter)
- multi (custom eLegere OData filter)
top
number Points how many items to fetch from the Detail table. The parameter is optional. If left empty, the default value will be 20.
Return¶
A Promise that returns a ReadResult object.
getItems Promise<ReadResult>
¶
1 |
|
getItems()
fetches one or more items from the Master table of the Application.
For Example:
1 2 3 4 5 |
|
Parameters¶
filter
string The parameter is a OData filter for detailName
: it points the items to retrive from the Master table. The parameter is optional.
filter
supports the following OData filters:
- eq
- ne
- gt
- ge
- lt
- le
- and
- or
- substringof
- dr (custom eLegere OData filter)
- multi (custom eLegere OData filter)
top
number Points how many items to fetch from the Master table. The parameter is optional.
Returns¶
A Promise that returns a ReadResult object.
saveMany Promise<SaveResult>
¶
1 |
|
saveMany
saves as row the elements of an array of items. The method saves them as row in the Master table. If the objects includes valid Id
and TIMESTAMP
system fields, it will update the rows identified by Id
instead.
For Example:
1 2 3 4 5 |
|
Parameters¶
items
object[] The parameter lists all the items to save. It requires the row Id and the Timestamp. The parameter constitutes a JavaScript object.
Return¶
A promise that returns SaveResult object.
saveManyDetail Promise<SaveResult>
¶
1 |
|
saveMany
saves as row the elements of an array of items. The method saves them as row in the Detail table of an Application. If the objects include valid Id
and TIMESTAMP
system fields, it will update the rows identified by Id
instead.
For Example:
1 2 3 4 5 6 |
|
Parameters¶
detailName
string Defines the specific Detail Tab containing the rows.
masterId
number Determines the Id of the Master row to associate to the item.
details
object[] Lists the item to save in the Detail table. The parameter constitutes a JavaScript object.
Return¶
A promise that returns SaveResult object.
saveOne Promise<SaveResult>
¶
1 |
|
saveOne
saves an item in the Master table of the Application.
For Example:
1 2 |
|
Parameters¶
item
object The parameter identifies the field and the row for the save. It must have the same fields as the row of the eLegere Master table. The parameter constitutes a JavaScript object. If the object includes valid Id
and TIMESTAMP
system fields, it will update the row identified by Id
instead.
Returns¶
A promise that returns SaveResult object.
saveOneDetail Promise<SaveResult>
¶
1 |
|
saveOneDetail()
saves one item of the Detail of an Application.If the object includes valid Id
and TIMESTAMP
system fields, it will update the row identified by Id
instead.
For Example:
1 2 3 |
|
Parameters¶
detailName
string Defines the specific Detail Tab containing the rows.
masterId
number Represents the Id of the Master row to associate a specific Detail table.
detail
object Represents the fields of the Detail to write. The parameter constitutes a JavaScript object.
Return¶
A promise that returns SaveResult object.
Results¶
ReadResult¶
1 |
|
Timestamp
and Items
. Timestamp
represents the time when the system has retrieved the data through the service. Items
represents the list of object retrieved from the database.
SaveResult¶
1 |
|
The SaveResult is an object containing the key IsSaveSuccesfully
. IsSaveSuccesfully
is a Boolean: if TRUE
, the script has saved the items with success; if FALSE
, an issue occurred during the save.