Open window in Same tab for the Service Operations workspace

smacleod
Tera Guru

Like many groups we have had to rebuild our Edit buttons for the workspace views. I have managed to get the declarative action to work properly in the Project workspace, however I am unable to get the open(url,'_self') script to work in the Service Operations Workspace.

 

I have tried:

open(url,'_self')

top.window.open(url,'_self')

g_navigation.open(url,'_self')

 

How do I get this to work in the Service Operations Workspace?

5 REPLIES 5

lauri457
Tera Sage

Look at the related list DAs with the label "Add" for how this should be implemented in workspaces. They open a modal with a list component to add records:

Screenshot 2026-04-14 091321.png

I have made a new Add button for the Service Operations workspace, however it does not work when we are in the Project workspace.

Not sure if you have to create your own page for the modal but you can try some of the existing ones. 

 

For example look at the DA with action_name "add_child_incident" sys_id=3838c09753213010ae50ddeeff7b1253.

 

Modify and insert the DA itself, then the record in the specify client action and modify the payload so that it matches what you need. Extensionpoint seems to be for the list filtering if you need that; the implementation requires a longer explanation itself: Next Experience - Using Extension Points in Declar... - ServiceNow Community 

{
  "label": "translate('Add')",
  "userGivenTable": "incident",
  "table": "{{table}}",
  "parentRecordSysId": "{{parentRecordSysId}}",
  "parentFieldName": "parent_incident",
  "referencedFieldName": "sys_id",
  "extensionPoint": "CHILD_INCIDENT_QUERY_FILTER",
  "view": "Default",
  "columns": "number,short_description,category,business_service,cmdb_ci,state,assignment_group,opened_at",
  "type": "o2m",
  "hideSelectAll": false,
  "relatedListName": "{{relatedListName}}",
  "asyncProperties": {
    "enableAsync": true,
    "asyncThreshold": 50,
    "relatedListLabelName": "{{label}}"
  }
}

Then create the UX Add-on Event Mapping record - you can just insert the existing one from the oob one to your new one. Change the source component and target event to what is on your project workspace page.

I have done this and have gotten the Add button working while in the service operations workspace. while it will automatically appear in the project workspace (no idea why) it will not do anything when I click the button.