0

I am trying to determine whether the user is in Lightning Console when they select a Quick Action (Lightning Component) but it comes back as regular Lightning UI no matter if the user is on a Console layout or not. I'm using same technique described here: Can a lightning web component know the difference between console and standard view?

Note, unlike OP, my user is not in Service Console.

1
  • Can you add the minimla required code please to see what you are trying to do? Aug 15, 2019 at 1:53

1 Answer 1

2

You can use isConsoleNavigation() for getting this information.

isConsoleNavigation()

Returns a Promise. Success resolves to true if console navigation is present, false otherwise. The Promise will be rejected on error.

Sample:

cmp:

<lightning:workspaceAPI aura:id="workspace" />
<lightning:button label="Is Console?" onclick="{! c.checkIfConsole }" />

JS:

checkIfConsole: function (component, event, helper) {
    var workspaceAPI = component.find("workspace");
    workspaceAPI.isConsoleNavigation()
    .then(function(infos){
        console.log("is Console? => ", JSON.stringify(infos));
    })
    .catch(err=>console.log("ERROR => ", err));
}
1
  • Thanks, just what I needed
    – snugsfbay
    Aug 15, 2019 at 17:59

You must log in to answer this question.

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