-
Functions
97
- alert
- ask
- back
- closeDialog
- confirm
- continueTo
- create
- createDocumentRecord
- createForm
- createQueryBuilder
- createRecord
- createTemplateContext
- createTransaction
- createWidget
- createWindow
- delete
- dial
- downloadVirtualFile
- executeTemplate
- exportToExcel
- get
- getApplianceId
- getApplianceTags
- getAppVersion
- getAudio
- getConfigParam
- getCountry
- getData
- getDataFunctions
- getDateFunctions
- getDeviceInfo
- getForm
- getGeneralFunctions
- getGeoLocation
- getIntegration
- getLanguage
- getMessageBus
- getNumericFunctions
- getOrganization
- getParameter
- getPdf
- getPlatformVersion
- getPlugin
- getPrivilegesFor
- getQueryHandle
- getResource
- getString
- getStrings
- getTemplate
- getTenantId
- getURI
- getUser
- getView
- getViewResponse
- getWidget
- hasFeature
- hideSpinner
- http
- importFromExcel
- invoke
- invokeAction
- invokePlatformService
- invokeService
- isAppliance
- isForcedOffline
- isHybrid
- isLoggedIn
- isMobile
- isOffline
- isUpdateAvailable
- isViewAccessible
- jsonpath
- loadResource
- log
- login
- logout
- mailTo
- message
- notify
- openDialog
- openFile
- playSound
- prompt
- removeAllForms
- removeForm
- renderString
- replaceTerm
- scheduleTask
- setData
- setUI
- setView
- showSpinner
- SMSTo
- unscheduleTask
- update
- updateApp
- uploadFile
alert ( opts: Object )
Shows an alert dialog to the user.
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Optional object for configuring the alert. Properties
|
ask ( options: Object )
Ask the user to select one of a set of options
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | options Options Properties
|
closeDialog ( data: Object )
Closes the current dialog.
Parameters
Name | Type | Description |
---|---|---|
data | Object | data Optional data to pass back. |
confirm ( options: Object )
Shows a Yes/No confirmation dialog to the user.
Parameters
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Configuration object. Properties
|
continueTo ( nextView: String )
Changes the currently shown view. Uses existing form data as the data for the new view.
Parameters
Name | Type | Description |
---|---|---|
nextView | String | The id of the next view. |
create ( record: Record , opts: Object ) →{ Promise }
Create a record
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
record | Record | record to create |
|||||||||
opts | Object | opts Options Properties
|
createDocumentRecord ( modelName: String , data: Object , file: Object ) →{ Promise }
Creates a DocumentRecord-object, this will upload the associated file-data and then create a DocumentRecord-object
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
modelName | String | modelName Name of model to create record of |
||||||||||||
data | Object | attributes and related records. |
||||||||||||
file | Object | file File options Properties
|
createForm ( options: Object ) →{ Form }
Create a new form in the current view
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | options Options Properties
|
createQueryBuilder ( options: Object ) →{ QueryBuilder }
Creates a query-builder
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options | Object | options Options Properties
|
createRecord ( modelName: String , data: Object , file: Object ) →{ Record }
Creates a Record-object
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
modelName | String | modelName Name of model to create record of |
||||||||||||
data | Object | attributes and related records. |
||||||||||||
file | Object | records Properties
|
createTemplateContext ( opts: Object ) →{ TemplateContext }
Creates a template context using the specified data and records.
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Optional configuration object Properties
|
Returns
The created context.
createTransaction ( ) →{ Transaction }
Creates a new transaction wrapping a set of database-operations.
createWidget ( opts: Object , value: Object ) →{ Promise }
Creates a new widget using the specified data.
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Configuration object. Properties
|
||||||||||||
value | Object | Value to set on the newly created widget |
createWindow ( opts: Object )
Creates a HTML dialog window.
Parameters
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | opts Configuration object. Properties
|
delete ( record: Record , opts: Object ) →{ Promise }
Delete a record
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
record | Record | record to delete |
|||||||||
opts | Object | opts Options Properties
|
dial ( number: String )
Dial a phone-number
Parameters
Name | Type | Description |
---|---|---|
number | String | The phone number to dial. |
downloadVirtualFile ( opts: Object )
Creates and downloads a virtual file using the provided data.
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Configuration object Properties
|
executeTemplate ( opts: Object ) →{ String }
Compiles a template string.
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
opts | Object | Configuration object Properties
|
Returns
The compiled template.
exportToExcel ( Array: Array , Options: Object ) →{ Promise }
Exports an array of records in Excel-format
Parameters
Name | Type | Description |
---|---|---|
Array | Array | Array of records |
Options | Object | Options |
get ( model: Model , id: String , options: Object ) →{ Promise }
Get a record
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
model | Model | model Model to get record of |
||||||
id | String | id ID of record to get |
||||||
options | Object | options Options Properties
|
getApplianceId ( ) →{ String }
Gets the ID of the appliance this application is running on
getApplianceTags ( ) →{ Array }
Returns the tags of this appliance (or an empty array if the app is not running on an appliance)
getAppVersion ( ) →{ Number }
Gets the version of the application
getAudio ( name: String )
Get an application resource as an audio-object by name or ID
Parameters
Name | Type | Description |
---|---|---|
name | String | Name or ID of resource to get |
getConfigParam ( name: String ) →{ ConfigurationParameter }
Returns a configuration parameter using the specified name, or null if no such parameter exists.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the parameter. |
getData ( name: String ) →{ Object }
Returns previously stored clientside data.
Parameters
Name | Type | Description |
---|---|---|
name | String | The identifier used when storing the data. |
Returns
The data, or the default value if none was found.
getDataFunctions ( ) →{ DataFunctions }
Gets the Data-API
getDateFunctions ( ) →{ DateFunctions }
Gets the Date-API
getDeviceInfo ( ) →{ Object }
Gets an object with properties describing the current device
getForm ( formId: String ) →{ Form }
Fetches a form from the current view using the provided form id.
Parameters
Name | Type | Description |
---|---|---|
formId | String | The id of the form to return. |
Returns
The form, or null if no form was found.
getGeneralFunctions ( ) →{ GeneralFunctions }
Gets the General API
getIntegration ( integration: String , options: Object )
Gets the API of an integration-module
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
integration | String | The name of the integration to get |
||||||
options | Object | options Properties
|
getLanguage ( ) →{ String }
Returns the language preferred by the current user
Returns
1 language code
getNumericFunctions ( ) →{ NumericFunctions }
Gets the Numeric API
getOrganization ( ) →{ Object }
Returns the current organization
getParameter ( name: String ) →{ QueryParameter }
Returns a query parameter using the specified name.
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the parameter. |
getPdf ( opts: Object ) →{ Promise }
Generates and downloads a pdf file
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | opts Options Properties
|
getPlatformVersion ( ) →{ String }
Gets the version of the Appivo platform
getPlugin ( plugin: String )
Gets the API of a plugin.
Parameters
Name | Type | Description |
---|---|---|
plugin | String | The name of the plugin to get. |
getPrivilegesFor ( record: Record , opts: Object )
Get all privileges for a certain record
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
record | Record | record to get privileges for |
|||||||||
opts | Object | opts Options Properties
|
getQueryHandle ( name: String ) →{ QueryHandle }
Returns a handle to a query.
Parameters
Name | Type | Description |
---|---|---|
name | String | name The name of the Query Handle. |
getResource ( name: String )
Get an application resource by name or ID
Parameters
Name | Type | Description |
---|---|---|
name | String | Name or ID of resource to get |
getString ( name: String , vars: Object )
Returns the localization string of the given name.
Parameters
Name | Type | Description |
---|---|---|
name | String | name The name of the localization string. |
vars | Object | vars Variables to use when localizing the string |
getStrings ( ) →{ Array }
Returns an array of the app's localization strings.
Returns
An holding all of the app's strings.
getTemplate ( id: String ) →{ Object }
Returns the template with the specified id.
Parameters
Name | Type | Description |
---|---|---|
id | String | The desired template's id. |
getURI ( url: String ) →{ String }
Returns the full URI of the specified URL.
Parameters
Name | Type | Description |
---|---|---|
url | String |
Returns
The full URI
getUser ( load: Boolean ) →{ User }
Returns the current user.
Parameters
Name | Type | Description |
---|---|---|
load | Boolean | load Force loading user from backend. This will make the function return a promise.s |
getViewResponse ( ) →{ Object }
Gets the returned data from the previously visited view (if any)
Returns
data returned from previous view or null if none is available
getWidget ( widgetId: String ) →{ BaseWidget }
Fetches a widget from the current view using the provided widget id.
Parameters
Name | Type | Description |
---|---|---|
widgetId | String | The widget id of the widget to return. |
Returns
The widget, or null if no widget was found.
hasFeature ( name: String ) →{ Boolean }
Checks if the user has the specified feature enabled.
Parameters
Name | Type | Description |
---|---|---|
name | String | The feature name |
Returns
True if the user has the feature enabled, otherwise false.
http ( opts: Object ) →{ Promise }
Send an http-request
Parameters
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | opts Request options Properties
|
importFromExcel ( File: File, Options: Object ) →{ Promise }
Imports records from an Excel-file
Parameters
Name | Type | Description |
---|---|---|
File | File | File to import from |
Options | Object | Options |
invoke ( funcName: String , args: Object ) →{ Object }
Invokes a function defined on the current view.
Parameters
Name | Type | Description |
---|---|---|
funcName | String | The name of the function. |
args | Object | Object with named arguments to pass to the function. These will be available via the args-parameter passed to the function. |
Returns
The functions return value, if any.
invokeAction ( opts: Object ) →{ Promise }
Invokes an action
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Object holding configuration for the invokation. Properties
|
Returns
A dojo deferred object (See the Dojo documentation.
invokePlatformService ( opts: Object ) →{ Promise }
Invokes a platform service
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Options Properties
|
invokeService ( options: Object ) →{ Promise }
Invokes a server-side REST rule.
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Object holding configurations for the invokation. Properties
|
Returns
A dojo deferred object (See the Dojo documentation.
isAppliance ( ) →{ Boolean }
Checks whether this application is running on an appliance
isForcedOffline ( ) →{ Boolean }
Checks whether the device is currently forced offline,
Returns
True if the device is forced offline
isHybrid ( ) →{ Boolean }
Checks whether we are running in the context of a hybrid mobile app
Returns
True if the current user is in the context of hybrid mobile app
isLoggedIn ( ) →{ Promise }
Checks whether the user is logged in or not. Note that this method returns a Promise that resolves to a boolean.
isMobile ( ) →{ Boolean }
Checks whether the current user is on a mobile device.
Returns
True if the current user is on a mobile device, otherwise false.
isOffline ( ) →{ Boolean }
Checks whether the device is currently offline,
Returns
True if the device is offline
isUpdateAvailable ( ) →{ Promise }
Check if an upgrade is available
isViewAccessible ( ) →{ Boolean }
Checks whether the user has the right to view the specified view.
Returns
True if the user is allowed to view the specified view, otherwise false.
jsonpath ( path: String , json: Object , opts: Object ) →{ Array }
Queries a json-document using JSON-path
Parameters
Name | Type | Description |
---|---|---|
path | String | path The path to query for |
json | Object | json Document to execute query on |
opts | Object | opts Options |
Returns
Array elements found
loadResource ( options: Object )
Loads an application resource as a JSON-object
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options | Object | Options Properties
|
log ( The: String )
Logs a message to the console.
Parameters
Name | Type | Description |
---|---|---|
The | String | The messag e to log. |
login ( opts: Object ) →{ Promise }
Login a user
Parameters
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | opts Options Properties
|
logout ( ) →{ Promise }
Logout the user
mailTo ( email: String )
Creates and opens a mailto: link.
Parameters
Name | Type | Description |
---|---|---|
String | The email adress to use for the link. |
message ( options: Object )
Shows a message notification to the user.
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Optional parameter for configuring the message. Properties
|
notify ( options: Object )
Shows a success/error notification to the user.
Parameters
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Contains the configuration for the notification. Properties
|
openDialog ( dialog: String , data: Record , opts: Object )
Opens a dialog view.
Parameters
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
dialog | String | The id of the dialog view. |
||||||
data | Record | An optional record that is used to populate form-connected widgets in the dialog. |
||||||
opts | Object | An object allowing for additional configurations. Properties
|
openFile ( A: Record ) →{ Promise }
Open a file for viewing
Parameters
Name | Type | Description |
---|---|---|
A | Record | record to view |
playSound ( name: String )
Plays the specified sound resource
Parameters
Name | Type | Description |
---|---|---|
name | String | The name of the sound resource. |
prompt ( opts: Object )
Shows a prompt dialog to the user. The prompt dialog prompts the user for some information.
Parameters
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | Configuration object. Properties
|
removeForm ( id: String )
Remove a dynamically created form
Parameters
Name | Type | Description |
---|---|---|
id | String | id ID of form to remove |
renderString ( template: String , data: Object ) →{ String }
TODO
Parameters
Name | Type | Description |
---|---|---|
template | String | Template to render |
data | Object | Variables to use when rendering the template |
replaceTerm ( name: String , vars: Object )
TODO
Parameters
Name | Type | Description |
---|---|---|
name | String | |
vars | Object |
scheduleTask ( options: Object ) →{ String }
Schedules a task to be performed in set intervals
Parameters
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Configuration object Properties
|
Returns
The id of the task. This is needed to stop the task.
setData ( name: String , value: Object , scope: String )
Stores clientside data.
Parameters
Name | Type | Description |
---|---|---|
name | String | An identifier for the data. Must be specified when loading the data again. |
value | Object | The value to store. |
scope | String | The availability scope of the data ('global' or 'persistent'). By default data is scoped to the current view only, global-scope means it will be available in all views but not persisted - persistent means it is global and persisted. |
setUI ( ui: Object , view: String , data: Object , query: Query)
Changes the currently shown ui.
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ui | Object | View Object Properties
|
|||||||||
view | String | An optional View id that should be navigated to |
|||||||||
data | Object | An optional record that is used to populate forms in the new view. |
|||||||||
query | Query | Optional custom data to pass to the view |
setView ( view: Object , data: Object , query: Query)
Changes the currently shown view.
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
view | Object | View Object Properties
|
|||||||||
data | Object | An optional record that is used to populate forms in the new view. |
|||||||||
query | Query | Optional custom data to pass to the view |
SMSTo ( tel: String )
Sends an SMS to the specified number
Parameters
Name | Type | Description |
---|---|---|
tel | String | The phone number to send to. |
unscheduleTask ( tid: String )
Stops a scheduled task.
Parameters
Name | Type | Description |
---|---|---|
tid | String | The id that was returned when scheduling the task. |
update ( record: Record , opts: Object ) →{ Promise }
Update a record
Parameters
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
record | Record | record to update |
|||||||||
opts | Object | opts Options Properties
|
updateApp ( ) →{ Promise }
Upgrade the application
uploadFile ( data: Object , options: Object ) →{ Promise }
Upload a file
Parameters
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data | Object | data contents of file to upload |
||||||||||||
options | Object | upload options Properties
|