I am trying to redirect into specific slide Tab in record page, we can simply achieve this by using workspace API but since workspace api is not supported in the Apps like sales and service etc, I am using navigation to Sobject, here's a sample code that I'm using.. `

toDetail : function(component, event, helper) {
        console.log('changeSubtab');
        //get record id from url
        var url = window.location.href;
        var recordId = url.substring(0, url.lastIndexOf('/'));
        recordId = recordId.substring(recordId.lastIndexOf('/') + 1);
        console.log('recordId: ' + recordId);

        //using navigation event to change subtab
        var navEvt = $A.get("e.force:navigateToSObject");
        navEvt.setParams({
            "recordId": recordId,
            "slideDevName": "related"
        });
        navEvt.fire();
        console.log('navEvt fired', navEvt);
    },

`

enter image description here

I am basically trying to redirecting it to the related tab but everytime it is redirecting to the default tab Activity, I have also added the line in the .cmp file `

    <aura:dependency resource="markup://force:navigateToSObject" type="EVENT"/>

`

0

There are 0 answers