cabrillo.nowapp - Client
The name space for Cabrillo Now App functions. This enables you to interact with screens inside of ServiceNow AI Platform® native mobile apps.
cabrillo.nowapp - openLauncherScreen(String launcherScreenId)
Opens a mobile launcher native screen.
| Name | Type | Description |
|---|---|---|
| launcherScreenId | String | Sys_id of the launcher screen from the Applet launcher [sys_sg_applet_launcher] table. |
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the method is available on the native side. Valid values:
|
const launcherScreenId = 'a9e30c7dc61122760116894de7bcc7bd';
const result = cabrillo.nowapp.openLauncherScreen(launcherScreenId);
If (result === false) {
console.log("method is not available")
}
Output:
true
cabrillo.nowapp - openScreen(String screenId)
Opens a mobile native screen.
| Name | Type | Description |
|---|---|---|
| screenId | String | The sys_id of the screen record to open from the Screen [sys_sg_screen] table. |
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the method is available on the native side. Valid values:
|
const screenId = 'a9e30c7dc61122760116894de7bcc7bd';
cabrillo.nowapp.openScreen(screenId);
If (result === false) {
console.log("method is not available")
}
Output:
true
cabrillo.nowapp - openScreenWithRecordContext(String screenId, String table, String recordId)
Opens a mobile native screen with a record context.
| Name | Type | Description |
|---|---|---|
| ScreenId | string | Sys_id of the screen record to open from the Screen [sys_sg_screen] table. |
| table | string | The record table. |
| record | string | The record sys_id. |
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the method is available on the native side. Valid values:
|
const screenId = 'a9e30c7dc61122760116894de7bcc7bd';
const recordId= '8e99daa3ff133100ba13757574847f2d';
const table= 'sys_users';
const result = cabrillo.nowapp.openScreenWithRecordContext(screenId, table, recordId);
If (result === false) {
console.log("method is not available")
}
Output:
true
cabrillo.nowapp - performFunction(String functionId, String table, String recordId)
Executes a native mobile function.
| Name | Type | Description |
|---|---|---|
| functionId | string | Sys_id of the target function from the Button [sys_sg_button] table. |
| table | string | The record table. Optional for Global Action items. For more information about mobile function, see Action functions. Note: Differences between Global and Record actions:
|
| recordId | string | The record sys_id. Optional for Global Action Items. For more information about mobile function, see Action functions. Note: Differences between Global and Record action items:
|
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the method is available on the native side. Valid values:
|
const functionId= 'a9e30c7dc61122760116894de7bcc7bd';
const recordId= '8e99daa3ff133100ba13757574847f2d';
const table= 'sys_users';
const result = cabrillo.nowapp.performFunction(functionId, table, recordId);
If (result === false) {
console.log("method is not available")
}
Output:
true
cabrillo.nowapp - refresh()
Refresh the UI stack in the event a table update is made in the web view that may affect a previous screen.
| Name | Type | Description |
|---|---|---|
| None |
| Type | Description |
|---|---|
| Boolean | Flag that indicates whether the method is available on the native side. Valid values:
|
const result = cabrillo.nowapp.refresh();
If (result === false) {
console.log("method is not available")
Output:
true