0
component.find("navId").navigate({
            type: 'standard__recordPage',
            attributes: {
                recordId: OppId,
                actionName: 'view',
                objectApiName: 'Opportunity'
            }
        }, true);

Above is my code which takes me to standard record but i want to go custom lightning record page which i created "CustomlightRecPage"

How i can navigate

0

Please try following code.

function : openTestComponent(cmp, e, h) {
    var pageReference = {
                        type: 'standard__component',
                        attributes: {
                            "componentName" : "c__CustomlightRecPag"
                        },
                        state: {
                            "c__recordId": cmp.get("v.OppId")
                        }
                    };
     e.preventDefault();
     var navService = cmp.find("navService");
     navService.navigate(pageReference);
     h.delayedRefresh(100);
 }
 
 helper.js
 
 delayedRefresh : function(ms){
        let ms = ms || 100;
        window.setTimeout($A.getCallback(function(){
            $A.get('e.force:refreshView').fire();
        }),ms);
    }
  • Not working when i click on button nothing happens – Sameer Jul 24 '20 at 5:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.