SOW - Add "Incident Tasks" tab

Leonardo Chave1
Kilo Sage

Hello SN experts,

 

I'm reaching out for your assistance, I'm trying to add a dedicate tab for "Incident Tasks" instead of searching this through the related records. For this I was following Now Create's steps, but I'm new with working with Extension points. Can you please guide me, the steps are:

 

"Goal: Achieve the Related list grouping by creating an implementation for the SOWRouteUtil scripted extension point. 

Procedure 

  1. Navigate to System extension points > Scripted extension points. 
  2. Open sn_sow_record.SOWRouteUtil. 
  3. To create an implementation, click the Create Implementation related link. 
  4. Specify the following details for the implementation script include. 
    • I tried to replicate the same as change but I got no luck "now/nav/ui/classic/params/target/sys_extension_point.do%3Fsys_id%3D5d2e5253eb323010e69783402a52283c%26sysparm_record_target%3Dsys_extension_point%26sysparm_record_row%3D1%26sysparm_record_rows%3D1%26sysparm_record_list%3Dapi_nameCONTAINSrouteu%255EORDERBYname"
  5. Click Update. 
  6. 6. Verify the functionality by opening an incident which has incident tasks associated with it. "

As a note I used the "Incident Management for SOW" scope.

thank in forwards!!! 

1 ACCEPTED SOLUTION

Leonardo Chave1
Kilo Sage

Digging up, I finally found what ocurred, it's due to a property. If no incident tasks are added, the related list or in this case the tab will be hidden. KB1188616

 

Now in case you want to know how I added the "Incident Tasks" tab and hide it from the related records, what you need to do is

LeonardoChave1_0-1741223860803.png

 

  1. Open the "SOWRouteUtil" extension point
  2. Click the "Create implementation"
  3. A script include will be created, renamed to something suitable for your update
    • In this case, I named it "SOWIncidentRouteUtilCustom"
  4. You'll need to extend the "SOWIncidentRouteUtil"
  5. Add or override the logic
  6. Once finished, open the "SOWRouteUtil" extension point and go to the bottom of the form to view the "Implementations" related list
  7. Filter by application, and add the "Order" field in case it isn't added
  8. To ensure you override OOB implementation set yours with a lower order, that will do the magic
  9. Finished

The code is similar than the one for change

 

var SOWIncidentRouteUtilCustom = Class.create();
SOWIncidentRouteUtilCustom.prototype = Object.extendsObject(sn_sow_inc.SOWIncidentRouteUtil, {
	
	initialize: function() {},

	getListsForRelatedListTab: function(relatedLists, table, tabName) {
		if (!relatedLists)
			return;
		var excludeLists = ["incident_task.incident"];
		var lists = [];

		if (tabName === 'related_list') {
			lists = relatedLists.filter(function(rl) {
				return excludeLists.indexOf(rl.value) === -1;
			});
		}

		return lists;
	},

	getRelatedListConfig: function(table, sysId) {

		var excludeLists = ["incident_task.incident"];
		var relatedRecordTab = this.RELATED_RECORD_TAB;
		relatedRecordTab["exclusionList"] = excludeLists;
		var result = [{"label": gs.getMessage("Incident Tasks"),
			"id": "sow_incident_tasks",
			"exclusionList": null,
			"inclusionList": excludeLists
			}];
		result.push(relatedRecordTab);

		return result;
	},

	type: 'SOWIncidentRouteUtilCustom'
});

 

 

View solution in original post

1 REPLY 1

Leonardo Chave1
Kilo Sage

Digging up, I finally found what ocurred, it's due to a property. If no incident tasks are added, the related list or in this case the tab will be hidden. KB1188616

 

Now in case you want to know how I added the "Incident Tasks" tab and hide it from the related records, what you need to do is

LeonardoChave1_0-1741223860803.png

 

  1. Open the "SOWRouteUtil" extension point
  2. Click the "Create implementation"
  3. A script include will be created, renamed to something suitable for your update
    • In this case, I named it "SOWIncidentRouteUtilCustom"
  4. You'll need to extend the "SOWIncidentRouteUtil"
  5. Add or override the logic
  6. Once finished, open the "SOWRouteUtil" extension point and go to the bottom of the form to view the "Implementations" related list
  7. Filter by application, and add the "Order" field in case it isn't added
  8. To ensure you override OOB implementation set yours with a lower order, that will do the magic
  9. Finished

The code is similar than the one for change

 

var SOWIncidentRouteUtilCustom = Class.create();
SOWIncidentRouteUtilCustom.prototype = Object.extendsObject(sn_sow_inc.SOWIncidentRouteUtil, {
	
	initialize: function() {},

	getListsForRelatedListTab: function(relatedLists, table, tabName) {
		if (!relatedLists)
			return;
		var excludeLists = ["incident_task.incident"];
		var lists = [];

		if (tabName === 'related_list') {
			lists = relatedLists.filter(function(rl) {
				return excludeLists.indexOf(rl.value) === -1;
			});
		}

		return lists;
	},

	getRelatedListConfig: function(table, sysId) {

		var excludeLists = ["incident_task.incident"];
		var relatedRecordTab = this.RELATED_RECORD_TAB;
		relatedRecordTab["exclusionList"] = excludeLists;
		var result = [{"label": gs.getMessage("Incident Tasks"),
			"id": "sow_incident_tasks",
			"exclusionList": null,
			"inclusionList": excludeLists
			}];
		result.push(relatedRecordTab);

		return result;
	},

	type: 'SOWIncidentRouteUtilCustom'
});