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.
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.
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.