BusinessObject

simplicite~ BusinessObject

new BusinessObject(ses, name, instanceopt)

Source:
Business object.
ou should never instanciate this class directly but rather call getBusinessObject to get a cached instance.
Parameters:
Name Type Attributes Description
ses object Session
name string Business object name
instance string <optional>
Business object instance name, defaults to js_<object name>

Members

(constant) cacheKey :string

Source:
Cache key
Type:
  • string

filters :object

Source:
Current filters
Type:
  • object

item :object

Source:
Current item
Type:
  • object

list :Array.<object>

Source:
Current list
Type:
  • Array.<object>

metadata :BusinessObjectMetadata

Source:
Object metadata
Type:
  • BusinessObjectMetadata

(constant) path :string

Source:
Path
Type:
  • string

Methods

action(action, rowIdopt, optsopt) → {promise.<(string|object)>}

Source:
Invoke a custom action
Parameters:
Name Type Attributes Description
action string Action name
rowId string <optional>
Row ID
opts object <optional>
Options
Properties
Name Type Attributes Description
parameters function <optional>
Optional action parameters as key/value pairs
error function <optional>
Error handler function
Returns:
A promise to the action result
Type
promise.<(string|object)>

count(filtersopt, optsopt) → {promise.<object>}

Source:
Count
Parameters:
Name Type Attributes Description
filters object <optional>
Filters, defaults to current filters if not set
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the count
Type
promise.<object>

create(item, optsopt) → {promise.<object>}

Source:
Create (create or update)
Parameters:
Name Type Attributes Description
item object Item (defaults to current item)
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the created record (also available as the item member)
Type
promise.<object>

crosstab(crosstab, optsopt) → {promise.<object>}

Source:
Build a pivot table
Parameters:
Name Type Attributes Description
crosstab string Pivot table name
opts object <optional>
Options
Properties
Name Type Attributes Description
filters object <optional>
Filters, by default current filters are used
error function <optional>
Error handler function
Returns:
A promise to the pivot table data (also avialable as the crosstabdata member)
Type
promise.<object>

del(item, optsopt) → {promise}

Source:
Delete
Parameters:
Name Type Attributes Description
item object Item (defaults to current item)
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise (the item member is emptied)
Type
promise

get(rowId, optsopt) → {promise.<object>}

Source:
Get
Parameters:
Name Type Attributes Description
rowId string Row ID
opts object <optional>
Options
Properties
Name Type Attributes Default Description
metadata boolean <optional>
false Refresh meta data?
fields Array.<string> <optional>
List of field names to return, all fields are returned by default
treeview string <optional>
Return the named tree view structure
error function <optional>
Error handler function
Returns:
Promise to the record (also available as the item member)
Type
promise.<object>

getCount()

Source:
Deprecated:
  • Yes
Count, **deprecated**: use count instead

getField(fieldName) → {object}

Source:
Get a field definition
Parameters:
Name Type Description
fieldName string Field name
Returns:
Field definition
Type
object

getFieldDataURL(field, itemopt) → {string}

Source:
Get the data URL of an inlined document/image field for item (or current item)
Parameters:
Name Type Attributes Description
field string | object Field name or definition
item object <optional>
Item (defaults to current item)
Returns:
Document/image field data URL (or nothing if the field is not of document/image type or if it is not inlined or if it is empty)
Type
string

getFieldDocument(field, itemopt) → {Document}

Source:
Get the field's value as document/image for item (or current item)
Parameters:
Name Type Attributes Description
field string | object Field name or definition
item object <optional>
Item (defaults to current item)
Returns:
Document/image (or nothing if the field is not of document/image type or if it is empty)
Type
Document

getFieldDocumentURL(field, itemopt, thumbnailopt) → {string}

Source:
Get the URL of a document/image field for item (or current item)
Parameters:
Name Type Attributes Default Description
field string | object Field name or definition
item object <optional>
Item (defaults to current item)
thumbnail boolean <optional>
false Thumbnail?
Returns:
Document/image field URL (or nothing if the field is not of document/image type or if it is empty)
Type
string

getFieldLabel(field) → {string}

Source:
Get field label
Parameters:
Name Type Description
field string | object Field name or definition
Returns:
Value
Type
string

getFieldListValue(field, code) → {string}

Source:
Get the list value of a list of values field for item (or current item)
Parameters:
Name Type Description
field string | object Field name or definition
code string Code
Returns:
Value
Type
string

getFields() → {array}

Source:
Get all fields definitions
Returns:
Array of field definitions
Type
array

getFieldType(field) → {string}

Source:
Get field type
Parameters:
Name Type Description
field string | object Field name or definition
Returns:
Type (one of constants.TYPE_*)
Type
string

getFieldValue(field, itemopt) → {string}

Source:
Get value of field for item (or current item)
Parameters:
Name Type Attributes Description
field string | object Field name or definition
item object <optional>
Item (defaults to current item)
Returns:
Value
Type
string

getFilters(optsopt) → {promise.<object>}

Source:
Get current filters
Parameters:
Name Type Attributes Description
opts object <optional>
Options
Properties
Name Type Attributes Description
context number <optional>
Context
reset boolean <optional>
Reset filters?
error function <optional>
Error handler function
Returns:
Promise to the object's filters (also available as the filters member)
Type
promise.<object>

getForCopy(rowId, optsopt) → {promise.<object>}

Source:
Get for copy
Parameters:
Name Type Attributes Description
rowId string Row ID to copy
opts object <optional>
Options
Properties
Name Type Attributes Default Description
metadata boolean <optional>
false Refresh meta data?
error function <optional>
Error handler function
Returns:
Promise to the record to create (also available as the item member)
Type
promise.<object>

getForCreate(optsopt) → {promise.<object>}

Source:
Get for create
Parameters:
Name Type Attributes Description
opts object <optional>
Options
Properties
Name Type Attributes Default Description
metadata boolean <optional>
false Refresh meta data?
error function <optional>
Error handler function
Returns:
Promise to the record to create (also available as the item member)
Type
promise.<object>

getForDelete(rowId, optsopt) → {promise.<object>}

Source:
Get for delete
Parameters:
Name Type Attributes Description
rowId string Row ID
opts object <optional>
Options
Properties
Name Type Attributes Default Description
metadata boolean <optional>
false Refresh meta data?
error function <optional>
Error handler function
Returns:
Promise to the record to delete (also available as the item member)
Type
promise.<object>

getForUpdate(rowId, optsopt) → {promise.<object>}

Source:
Get for update
Parameters:
Name Type Attributes Description
rowId string Row ID
opts object <optional>
Options
Properties
Name Type Attributes Default Description
metadata boolean <optional>
false Refresh meta data?
error function <optional>
Error handler function
Returns:
Promise to the record to update (also available as the item member)
Type
promise.<object>

getHelp() → {string}

Source:
Get help
Returns:
Help
Type
string

getInstance() → {string}

Source:
Get instance name
Returns:
Instance name
Type
string

getLabel() → {string}

Source:
Get display label
Returns:
Display label
Type
string
Source:
Get links
Returns:
Array of links
Type
array

getListValue(list, code) → {string}

Source:
Get list value for code
Parameters:
Name Type Description
list list List of values
code string Code
Returns:
Value
Type
string

getMetaData(optsopt) → {promise.<BusinessObjectMetadata>}

Source:
Get meta data
Parameters:
Name Type Attributes Description
opts object <optional>
Options
Properties
Name Type Attributes Description
context number <optional>
Context
contextParam string <optional>
Context parameter
error function <optional>
Error handler function
Returns:
A promise to the object'ts meta data (also available as the metadata member)
Type
promise.<BusinessObjectMetadata>

getName() → {string}

Source:
Get name
Returns:
Name
Type
string

getParameter(param, optsopt) → {promise.<object>}

Source:
Get an object parameter
Parameters:
Name Type Attributes Description
param string Parameter name
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the parameter value
Type
promise.<object>

getResourceURL(code, typeopt)

Source:
Get an object resource URL
Parameters:
Name Type Attributes Default Description
code string Resource code
type string <optional>
IMG Resource type (IMG=image (default), ICO=Icon, CSS=stylesheet, JS=Javascript, HTML=HTML)

getRowId(itemopt) → {string}

Source:
Get specified or current item's row ID value
Parameters:
Name Type Attributes Description
item object <optional>
Item, defaults to current item
Returns:
Item's row ID value
Type
string

getRowIdField() → {object}

Source:
Get row ID field definition
Returns:
Row ID field definition
Type
object

getRowIdFieldName() → {string}

Source:
Get row ID field name
Returns:
Row ID field name
Type
string

isRowIdField(field) → {boolean}

Source:
Is the field the row ID field?
Parameters:
Name Type Description
field object Field definition
Returns:
True if the field is the row ID field
Type
boolean

isTimestampField(field) → {boolean}

Source:
Is the field a timestamp field?
Parameters:
Name Type Description
field object Field definition
Returns:
True if the field is a timestamp field
Type
boolean

populate(rowId, optsopt) → {promise.<object>}

Source:
Populate
Parameters:
Name Type Attributes Description
rowId string Row ID
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the populated record (also available as the item member)
Type
promise.<object>

print(prt, rowIdopt, optsopt) → {promise.<Document>}

Source:
Build a custom publication
Parameters:
Name Type Attributes Description
prt string Publication name
rowId string <optional>
Row ID
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
A promise to the document of the publication
Type
promise.<Document>

save(item, optsopt) → {promise.<object>}

Source:
Save
Parameters:
Name Type Attributes Description
item object Item (defaults to current item)
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the saved record (also available as the item member)
Type
promise.<object>
Source:
Search
Parameters:
Name Type Attributes Description
filters object <optional>
Filters, defaults to current filters if not set
opts object <optional>
Options
Properties
Name Type Attributes Default Description
page number <optional>
Page number, a non paginated list is returned if not set
metadata boolean <optional>
false Refresh meta data?
visible boolean <optional>
Return only visible fields?
error function <optional>
Error handler function
Returns:
Promise to a list of records (also available as the list member)
Type
promise.<array>

setParameter(param, value, optsopt) → {promise.<object>}

Source:
Set an object parameter
Parameters:
Name Type Attributes Description
param string Parameter name
value string Parameter value
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise
Type
promise.<object>

update(item, optsopt) → {promise.<object>}

Source:
Update
Parameters:
Name Type Attributes Description
item object Item (defaults to current item)
opts object <optional>
Options
Properties
Name Type Attributes Description
error function <optional>
Error handler function
Returns:
Promise to the updated record (also available as the item member)
Type
promise.<object>