function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Debabrata BeraDebabrata Bera 

Create a custom button which opens the 'Manage Contact Roles' page in Contact Role

I have created custom Contact Role in lightning component where i need button functionality for 'Manage Contact Roles' for the current opportunity.

Please let me know if anyone have answer.
Meghna Vijay 7Meghna Vijay 7
One question will that lightning component be on Opportunity record page ? If yes, then you can use force:hasRecordId interface in the lightning component to get current opportunity record id. 
Thanks
Debabrata BeraDebabrata Bera
Yes on Opportunity record page. I want to pop up below salesforce screen in my custom 'Manage Contact Roles' button.
I have tried this but not working. May be i'm going to wrong direction.

doManageRoles : function(component, event) {
        var oppId = component.get("v.recordId");
        var url = "/apex/OpportunityContactRole?id=" + oppId;        
        console.log('doManageRoles(). url = ' + url);        
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url":url,
            "isredirect" : true
        });
        urlEvent.fire();
    }

User-added image
Meghna Vijay 7Meghna Vijay 7
If you want it in pop up why not use Modal Box in lightning ? Because navigateToURL will navigate it to the apex page.
https://www.lightningdesignsystem.com/components/modals/
Thanks