Some time we need to open utility bar when lightning app is loaded. This is required when we want to run some background job like update user record or initialize user session when page is loaded.
Use Case:
SalesforceCodex.com is running multi program health system built on Salesforce Platform. Business want when user will open lightning app they will get program selection screen.
Solution:
To handle this business requirement, we can use lightning utility bar. We can put lightning component in utility bar. When lightning app will be loaded that lightning component will open automatically.

We have to check flag ‘Start Automatically‘ for lightning component in utility bar.
Let us see lightning component code which will show program selection on page load.
We have to use getAllUtilityInfo of lightning:utilityBarAPI to get current utility bar and then open that utility bar.
Test Page:

References:
Related Posts
- How to Use Image Cropper in Salesforce Lightning Web Component
- Configurable Record Picker in Lightning Web Component
- Displaying Tabular Data with GraphQL in Lightning Web Component
- Export Data from Lightning Web Component to Excel Sheet
- Generate PDF using jsPDF in Lightning Web Component
- Custom Image Slider in Lightning Web Component

Dhanik Lal Sahni is a Salesforce Solution Architect, Independent Consultant, and the founder of SalesforceCodex.com. With nearly two decades of IT experience and extensive expertise in Salesforce architecture, he helps startups and enterprises design scalable, secure, and high-performance CRM solutions using Sales Cloud, Service Cloud, Experience Cloud, Data Cloud, Apex, Lightning Web Components (LWC), and enterprise integration patterns.
Through SalesforceCodex, he shares practical tutorials, real-world implementation guides, enterprise architecture best practices, and interview preparation resources for Salesforce Developers, Architects, and Administrators.
Learn more about his Salesforce consulting and freelance services at dhaniksahni.com.

1 Comment
Pingback: Open Utilty Bar On the Onload (connectedCallback) functtion LWC Component – GrindSkills