Service Operation Workspace - I want to move the related list one after the other (separate tabs)

Kiruthika J
Tera Contributor

Hi All,
I want to move the related list of interaction or all table from vertical to horizontal.

KiruthikaJ_0-1761564221578.png

I have gone through below community post but I'm not sure after going to  sn_sow_record.SOWRouteUtil and clicked create implementation and how to proceed further.

https://www.servicenow.com/community/next-experience-blog/service-operations-workspace-showing-relat...

Thank you !!



9 REPLIES 9

I have created create implementation under scripted extension point sn_sow_record.SOWRouteUtil.
The script include under extension instance 

var SOWInteractionRouteUtilCustom = Class.create();
SOWInteractionRouteUtilCustom.prototype = Object.extendsObject(sn_sow_record.SOWRouteUtil, {
    initialize: function() {},

    // Run only for the interaction table
    handles: function(table, sysId) {
        return table == 'interaction'; // <-- change if your table name differs (case-sensitive)
    },

    // Control which lists show on the 'related_list' (standard) tab
    getListsForRelatedListTab: function(relatedLists, table, tabName) {
        if (!relatedLists)
            return;
        // put the REL:... ids you want removed from the standard tab here
        var excludeLists = ["REL:c954ccb33b501300a0bd8cd834efc4b7", "REL:41c0829d1b4bf41087c842eacd4bcbf4"];
        var lists = [];

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

    // Return array of tab objects: your custom tabs first, then the standard related tab
    getRelatedListConfig: function(table, sysId) {
        // Related lists to hide from default "Related Records" tab
        var excludeLists = ["REL:c954ccb33b501300a0bd8cd834efc4b7", "REL:41c0829d1b4bf41087c842eacd4bcbf4"];

        // Prepare standard related tab and add the exclusions
        var relatedRecordTab = this.RELATED_RECORD_TAB;
        relatedRecordTab["exclusionList"] = excludeLists;

        // Create your own tab(s) with included related lists
        var result = [
            {
                "label": gs.getMessage("My Interaction Items"), // tab label
                "id": "sow_interaction_items",
                "exclusionList": null,
                // put the REL:... IDs you want shown on this tab
                "inclusionList": ["REL:c954ccb33b501300a0bd8cd834efc4b7", "REL:41c0829d1b4bf41087c842eacd4bcbf4"]
            }
        ];

        // Add the standard tab last so "other" related lists appear there
        result.push(relatedRecordTab);

        return result;
    },

    type: 'SOWInteractionRouteUtilCustom'
});
KiruthikaJ_0-1761645341867.png

KiruthikaJ_1-1761645391749.png

could you please let me know what i'm missing here?


Thank you!!

 



@Kiruthika J 

will have to try in my PDI

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Kiruthika J 

I was able to have this output.

I believe I provided an approach for you an you can play with this further.

It's just that the same related list is coming again within each tab

var SOWInteractionRouteUtil = Class.create();
SOWInteractionRouteUtil.prototype = {
    initialize: function() {},

    getRecordRoutes: function(table, sysId) {
        /* intentionally left blank */
    },

    getListsForRelatedListTab: function(relatedLists, table, tabName) {
        /* intentionally left blank */
        // if (!relatedLists)
        //     return;
        // var excludeLists = ["REL:e9343b6a873303002ae97e2526cb0b00"];
        // var lists = [];

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

    getRelatedListConfig: function(table, sysId) {

        //Standard related lists tab configuration
        //var relatedRecordTab = RELATED_RECORD_TAB;

        //List of objects, each object is a separate tab
        var result = [{
                "label": gs.getMessage("Related Tasks"),
                "id": "related_tasks",
                "exclusionList": null,
                "inclusionList": ["REL:e9343b6a873303002ae97e2526cb0b00"] //Related lists to show on the tab
            },
            {
                "label": gs.getMessage("User's Interaction"),
                "id": "user_interaction",
                "exclusionList": null,
                "inclusionList": ["REL:e32c8b0353602110ad0fddeeff7b12ef"] //Related lists to show on the tab
            },
            {
                "label": gs.getMessage("User's Assets"),
                "id": "user_assets",
                "exclusionList": null,
                "inclusionList": ["REL:e32c8b0353602110ad0fddeeff7b12ef"] //Related lists to show on the tab
            },
            {
                "label": gs.getMessage("Interaction Related Records"),
                "id": "interaction_related_records",
                "exclusionList": null,
                "inclusionList": ["interaction_related_record.interaction"] //Related lists to show on the tab
            }
        ];
        // result.push(relatedRecordTab);

        return result;
    },

    handles: function(table, sysId) {
        return table === "interaction";
    },

    type: 'SOWInteractionRouteUtil'
};

AnkurBawiskar_0-1761650737290.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Kiruthika J Wy do you want to switch to this?

 

I would agree with @Ankur Bawiskar @Dr Atul G- LNG , it is best to drop this customization.


Please mark the answer correct/helpful accordingly.


Raghav
MVP 2023
LinkedIn