2

I have added the lightning web component into utility bar and after the save button it should be able to auto close the utility bar.

I have searched through the web but haven't got an answer on how to do that. Any thoughts?

2 Answers 2

3

It is not supported yet in LWC.

Bring modern, blazing-fast Lightning web components (LWC) into the utility bar by adding the lightning__UtilityBar target to your LWC‘s meta configuration. LWC utilities don’t yet support APIs or being used as background utility items.

Please refer

In the Aura components, there is an API for it.

HTML

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <lightning:utilityBarAPI aura:id="utilitybar" />
    <lightning:button label="Minimize Utility" onclick="{! c.minimizeUtility }" />
</aura:component>

Controller

({
    minimizeUtility : function(component, event, helper) {
        var utilityAPI = component.find("utilitybar");
        utilityAPI.minimizeUtility();
    }
})

One possible solution I can think of is wrapping the Lightning web component in the Aura component.

3
  • Rahul, Is it supported in LWC now? Commented Apr 18, 2023 at 12:54
  • @NirmalPrajapat I think its not yet supported, as per the linked document. Commented Apr 18, 2023 at 12:58
  • Ok Rahul, thanks Commented Apr 18, 2023 at 13:02
0

It is supported now. Check this https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lwc_minimize.htm

1
  • Welcome to Salesforce SE! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Commented Jun 25 at 17:01

You must log in to answer this question.

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