0

I am rendering a Visualforce Page in the call center for my salesforce CTI. On this Visualforce Page, i am rendering a lightening component.

In this lightening component i am using lightning:navigation, to navigate and open the detail pages of Case/Contact, when needed

In my component i have defined lightning:navigation like this -

<lightning:navigation aura:id="navService" />

To open the pages, i am using it like this in the controller -

 var navService = params.component.find('navService');
  var pageReference = {
    type: 'standard__recordPage',
    attributes: {
      actionName: 'view',
      recordId: payload.id,
    },
  };
  navService.navigate(pageReference);

This code works fine for navigation if i render this lightening component directly somewhere.

But when i render this component in a Visualforce Page, then this navigation does not work. There is no error or api calls in network.

I understand this might be happening because the Visualforce Page renders in an iframe, so now the lightening component is rendering in an iframe. So in that case, is there a way to navigate to another page in a VisualForce page?

Please help.

1 Answer 1

0

In Visualforce, use the sforce.one commands, such as:

sforce.one.navigateToSObject(payload.id);
1
  • for me sforce.one is coming as undefined. is there anyway to fix that?
    – ghostCoder
    Commented Apr 10, 2023 at 19:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .