- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2023 11:48 AM
The Service Operations Workspace includes a page/variant for rendering records called Record SNC. It is different from what you get if you start with a template such as "Standard record" or "CSM default record" and create your own record variant. The latter includes nearly everything the SNC version has, but is much more configurable since Record Page Tabs is not monolithic. It may also have newer components based on what appears to be updated behaviors. However...
A record variant created from a template does not contain all the same Handled events on the body element as the Record SNC variant. For this reason, it's not clear how to implement declarative actions such as the Add button on the Affected CIs related list on Incident. In particular "[Record Page] Open modal" along with the script and related client state variables are missing. In addition, there appear to be gaps in what we can observe of how this is accomplished on Record SNC. For instance, the (viewport) Modal container has no Page Collection specified, nor any properties using the "bare" and "displayOptions" client state variables set by the script.
Has anyone been able to open the Viewport modal (specifying a page from the associated page collection) from a declarative action on one of the new record template-generated variants? Can you point us in the right direction?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 10:44 AM
We got a solution from ServiceNow Support. It's not (yet?) documented, so, just in case anyone else in the whole world is delving into using these newer Record Templates, here's what we learned:
Starting with this (not quite up-to-date) document: How to create an "Add" button on a related list to open in a popup modal in configurable workspace -...
When you get to the part about creating a sys_ux_addon_event_mapping record, take these couple of left turns:
- Notice that after you click New, there is a "Source component" and "Controller" field. Once you start making selections, UI Policies make these diappear, but we need them for the newer components (macroponents) used by the templates that got us down this path
- Source component: List - Related
- Controller: Form
- Target Event: ...uh...
- oops, the Reference Qualifier for this field is dependent on Parent Macroponent, which just went away due to the UI Policy after selecting a Source Component, so...
- Open sys_ux_event_list.do and search for Label=[Record Page] Open modal or Event Name=RECORD#OPEN_MODAL, grab its sys_id and somehow coerce it into Target Event
- Insert-and-stay is the easy answer here (from a similarly configured mapping record)
- Script works too. I tried it just so I'd know
OK, one more left turn. I'd mentioned in my initial question that I could not close the gap in how the Action (button) specified the list picker page (mra) in the page collection launched by the viewport modal. Here's the thing I missed:
- A sys_ux_app_route must be created for each page/variant (in this case a record variant) created from one of these templates that specifies what to do with mra routes. If you have other mra-dependent actions to enable, this one route record will serve them all for your record variant.
- Name: whatever you want it to be
- Route: mra
- Screen Collection: DA Modal Multi-Record Associator
- App Configuration: -blank-
- Parent Macroponent: this is the record variant we've been trying to get working. Find yours.
- Parent Macroponent Composition Element ID: modalContainerViewport
- Fields: userGivenTable,table,label,parentRecordSysId,parentFieldName,referencedFieldName,extensionPoint,view,columns,hideSelectAll,type,relatedListName
- This looks a lot like the list of values in the Payloads of other records in this exercise
That's it!
I think what's going on is that they've pulled the controller functionality out of the (I'm going to call it legacy) Record SNC. In fact, if you navigate to that Form controller referenced from sys_ux_addon_event_mapping, then navigate to the Definition macroponent (Form Controller) you'll see a significant list of Handled Events. This is what was missing from the record variant created originally from the template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2023 10:44 AM
We got a solution from ServiceNow Support. It's not (yet?) documented, so, just in case anyone else in the whole world is delving into using these newer Record Templates, here's what we learned:
Starting with this (not quite up-to-date) document: How to create an "Add" button on a related list to open in a popup modal in configurable workspace -...
When you get to the part about creating a sys_ux_addon_event_mapping record, take these couple of left turns:
- Notice that after you click New, there is a "Source component" and "Controller" field. Once you start making selections, UI Policies make these diappear, but we need them for the newer components (macroponents) used by the templates that got us down this path
- Source component: List - Related
- Controller: Form
- Target Event: ...uh...
- oops, the Reference Qualifier for this field is dependent on Parent Macroponent, which just went away due to the UI Policy after selecting a Source Component, so...
- Open sys_ux_event_list.do and search for Label=[Record Page] Open modal or Event Name=RECORD#OPEN_MODAL, grab its sys_id and somehow coerce it into Target Event
- Insert-and-stay is the easy answer here (from a similarly configured mapping record)
- Script works too. I tried it just so I'd know
OK, one more left turn. I'd mentioned in my initial question that I could not close the gap in how the Action (button) specified the list picker page (mra) in the page collection launched by the viewport modal. Here's the thing I missed:
- A sys_ux_app_route must be created for each page/variant (in this case a record variant) created from one of these templates that specifies what to do with mra routes. If you have other mra-dependent actions to enable, this one route record will serve them all for your record variant.
- Name: whatever you want it to be
- Route: mra
- Screen Collection: DA Modal Multi-Record Associator
- App Configuration: -blank-
- Parent Macroponent: this is the record variant we've been trying to get working. Find yours.
- Parent Macroponent Composition Element ID: modalContainerViewport
- Fields: userGivenTable,table,label,parentRecordSysId,parentFieldName,referencedFieldName,extensionPoint,view,columns,hideSelectAll,type,relatedListName
- This looks a lot like the list of values in the Payloads of other records in this exercise
That's it!
I think what's going on is that they've pulled the controller functionality out of the (I'm going to call it legacy) Record SNC. In fact, if you navigate to that Form controller referenced from sys_ux_addon_event_mapping, then navigate to the Definition macroponent (Form Controller) you'll see a significant list of Handled Events. This is what was missing from the record variant created originally from the template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2025 02:56 AM
Can you export the Knowledge article as a PDF and attach it? I'm unable to view it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2025 02:02 PM
Thanks @Foster, This really helped for one of my long pending issue.