K2 Business Apps

This control allows you to interact with K2 Business Apps. You can perform app specific actions and get or set certain values in the app.

Note

The K2 Business Apps control is only shown in design time.

Properties

Details

Name

The name of the control.

Events

Photo

Contains the last photo confirmed by the user after using the Start Camera action.

Swipe Action ID

Contains the last swipe action selected by the user.

Events

On Download Tile Map Finished

This event is triggered when the action Download Tile Map is finished.

On List View Item Swiped Left

This event is triggered when a list view item was swiped left. It will only be called when the rule Add List View Swipe Gestures has been called before and specified items on the left side. The data source bound to the view will now contain the values for the swiped row.

On List View Item Swiped Right

This event is triggered when a list view item was swiped right. It will only be called when the rule Add List View Swipe Gestures has been called before and specified items on the right side. The data source bound to the view will now contain the values for the swiped row.

On Photo Ready

This event is triggered when a photo is confirmed after starting the camera with the rule Start Camera.

Actions

Add List View Swipe Gestures

This allows you to add swipe actions to list view items and thus only works when called on a list view. You can specify actions on both the left and right side. All text inputs may contain a semicolon separated list in order to specify multiple actions on a side. If you specify multiple items, make sure the lists are of equal length. When an item is selected, one of two events is triggered: On List View Item Swiped Left or On List View Item Swiped Right. In these events, you can use the property Swipe Action ID to determine which of the actions was selected by the user.

Left: Enabled

Yes to enable the left items, no (default) to disable them.

Left: IDs

The identifiers for the left actions. These can be used to determine which action was selected in case there are multiple.

Left: Texts

The texts that will be shown on the left actions.

Left: Icons

FontAwesome codes (4 characters) to specify the icon to show on the left actions.

Left: Colors

Hexadecimal values in the format #rrggbb to set the background color of the left actions.

Right: Enabled

Yes to enable the right items, no (default) to disable them.

Right: IDs

The identifiers for the right actions. These can be used to determine which action was selected in case there are multiple.

Right: Texts

The texts that will be shown on the right actions.

Right: Icons

FontAwesome codes (4 characters) to specify the icon to show on the right actions.

Right: Colors

Hexadecimal values in the format #rrggbb to set the background color of the right actions.

Debug

For internal use only.

Download Data Source

Downloads a data source so it can be used in offline mode.

Download Tile Map

Downloads a map that can be used in the Leaflet control.

Get Global Parameter

Get a previously set global parameter.

Get Prefer Work Offline

Returns whether the user currently wants to work offline.

Is App

Returns true when executed in K2 Business Apps and false when executed in the browser.

Is Online

Returns true when there is internet and the user settings allow us to use it.

New GUID

Returns a new globally unique identifier.

Remove Global Parameter

Deletes a global parameter.

Resize Image

Allows you to resize a given image. The inputs are a K2 image (e.g. from the image attachment control) and the maximum dimension of the image. The output is a K2 image.

Scroll To

Allows you to scroll to a specified view or control on a view. The method has two inputs:

View Name

The name of the view as specified on the form.

Control Name

The name of the control as specified on the view.

  • If only a view is provided, this method will scroll to that view.

  • If only a control is provided, this method will scroll to that control. Just remember that form controls are not rendered by K2 Business Apps.

  • If both a view and a control are provided, this method will scroll to the control on the view.

Note

This method also works in the browser.

Set Draft Information

Allows you to set the title and description of the current draft. Use this to differ between drafts created from the same template.

Set Global Parameter

Creates a global parameter.

Set Language

Allows you to force the entire app to a certain language. You can provide either the LCID string or decimal found here. The languages supported are: * English (US) * Dutch (NL)

Set List View Layout

Allows you to specify a custom layout for a list view by defining a grid and location for each control in the grid.

Set Prefer Work Offline

Sets whether the user prefers to work in offline mode or online mode.

Set Project

Sets the project the user is working on.

Start Camera

Allows you to start the camera from a rule. You can specify the maximum amount of photos that can be taken after another before the camera is closed. After each confirmed photo, the event OnPhotoReady is triggered. The property Photo on the K2 Business Apps control now contains the photo.

Submit Form

After creating a draft, you may want to remove it from the app at some point. This can be called once all data of a draft has been handled and the form in the app is considered completed.

Subscribe To Notification Topic

Allow you to subscribe someone to a certain notification topic.

Unsubscribe From Notification Topic

Allows you to remove someone from a certain notification topic.