The new tab menu allows agents to create new records in a workspace without having to first navigate to a list. I recently had a requirement to add an additional item to this menu which opens a new incident with the impact and urgency fields set to high. Here’s how I did it:
- I started with this documentation page which showed me where this menu is configured. Go to the “Experiences” module and find Service Operations Workspace
- In the UX Page Properties related list, choose the chrome_tab record
- The value field has the following JSON:
{
"contextual": [
"record",
"kb_view"
],
"newTabMenu": [
{
"label": {
"translatable": true,
"message": "New Interaction"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "interaction",
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "interaction",
"canCreate": true
}
}
},
{
"label": {
"translatable": true,
"message": "New Incident"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "incident",
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "incident",
"canCreate": true
}
}
}
],
"maxMainTabLimit": 10,
"maxTotalSubTabLimit": 30
}
4. To add another item to the new tab menu, we need to add an additional object to the newTabMenu array. We can copy the New Incident object and an additional “params” property to prepopulate the Impact, Urgency and Priority fields.
Note that I populate the Priority field because if I don’t it will display to the user with the default value until the record is saved. This may cause confusion. If your Impact/Urgency matrix is different than the OOB configuration, you may have to adjust the values.
{
"label": {
"translatable": true,
"message": "New Critical Incident"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "incident",
"sysId": "-1"
},
"params":{"query":"impact=1^urgency=1"},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "incident",
"canCreate": true
}
}
}
label.message | This is what is displayed in the new tab menu. |
routeInfo.route | Any route in the sys_ux_app_route table. Most of the time this will point to a page in UI Builder for the workspace you’re in (SOW in this case). Here we are going to the record page. |
routeInfo.fields | These are the required parameters for the page in the routeInfo.route property. For the record page, the required parameters are table and sysId. A sysId of -1 means a new record. |
routeInfo.params | Here is where we set our values. The query property takes an encoded query. |
routeInfo | The above three properties give us the following URL /now/sow/record/incident/-1/params/query/impact=1^urgency=1^priority=1 |
condition.tableDescription | This controls the visibility of the menu item. In this case, the item is only visible if the user can create a record on the incident table. |
The final value for the field is below
{
"contextual": [
"record",
"kb_view"
],
"newTabMenu": [{
"label": {
"translatable": true,
"message": "New Interaction"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "interaction",
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "interaction",
"canCreate": true
}
}
},
{
"label": {
"translatable": true,
"message": "New Incident"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "incident",
"sysId": "-1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "incident",
"canCreate": true
}
}
},
{
"label": {
"translatable": true,
"message": "New Critical Incident"
},
"routeInfo": {
"route": "record",
"fields": {
"table": "incident",
"sysId": "-1"
},
"params": {
"query": "impact=1^urgency=1^priority=1"
},
"multiInstField": "sysId"
},
"condition": {
"tableDescription": {
"table": "incident",
"canCreate": true
}
}
}
],
"maxMainTabLimit": 10,
"maxTotalSubTabLimit": 30
}
Users can now see the New Critical Incident when they click the plus sign in workspace