0

I have created a custom lightning component for users to create new Case from the Account related tab. However standard events such as "navigateToSObject", "navigateToObjectHome" are not firing after I moved the code from a development sandbox to a full copy Sandbox. When I click on 'Submit', the case is getting created. However the user wont be redirected to the newly created case and on clicking the 'Cancel' button, the user wont be redirected back to the Account page. Below is the code I am using for 'Cancel'

<lightning:button variant = "neutral" onclick="{!c.cancelAction}" label="Cancel" />


cancelAction : function(component, event, helper) 
{
    if(component.get("v.accountId"))
    {
        var sObectEvent = $A.get("e.force:navigateToSObject");
        sObectEvent .setParams(
            {
                "recordId": component.get("v.accountId"),
                "slideDevName": "detail"
            }
        );
        sObectEvent.fire();

    }
    else
    {
        var homeEvt = $A.get("e.force:navigateToObjectHome");
        homeEvt.setParams
        (
            {
                "scope": "Case"
            }
        );
        homeEvt.fire();
    }  
}

Has anyone else faced this issue before?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.