+ Start a Discussion
user23232323user23232323 

How to auto-close utility window?

I have a lightning component that opens from the Utility bar called OutOfOffice, the customer would like the window to auto close after pressing the Save button. Does anyone know how this can be accomplished? See the image below for visual.
User-added image
Best Answer chosen by user23232323
Raj VakatiRaj Vakati
You can able to do it by calling the  minimizeUtility() for Lightning Experience of lightning:utilityBarAPI  method that will miniize the utility window .. 

I dnt think so there is an option to close it explicitly


https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_minimizeItem.htm

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_methods_lightning_utility.htm 

 
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <lightning:utilityBarAPI aura:id="utilitybar" />
    <lightning:button label="Minimize Utility" onclick="{! c.minimizeUtility }" />
</aura:component>
 
({
    minimizeUtility : function(component, event, helper) {
        var utilityAPI = component.find("utilitybar");
        utilityAPI.minimizeUtility();
    }
})

 

All Answers

Raj VakatiRaj Vakati
You can able to do it by calling the  minimizeUtility() for Lightning Experience of lightning:utilityBarAPI  method that will miniize the utility window .. 

I dnt think so there is an option to close it explicitly


https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_lightning_minimizeItem.htm

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_methods_lightning_utility.htm 

 
<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
    <lightning:utilityBarAPI aura:id="utilitybar" />
    <lightning:button label="Minimize Utility" onclick="{! c.minimizeUtility }" />
</aura:component>
 
({
    minimizeUtility : function(component, event, helper) {
        var utilityAPI = component.find("utilitybar");
        utilityAPI.minimizeUtility();
    }
})

 
This was selected as the best answer
Gary WGary W
I found an installable flow action that will minimise the utility bar item for you. It worked great for me.
https://unofficialsf.com/minimize-the-window-when-a-utility-bar-flow-is-finished-evan-ponter/