Utility Barのまとめ

[まとめページに戻る](https://qiita.com/Keiji_otsubo/items/60afc2a8d211b6f7d89f)
[まとめN～Z](https://qiita.com/Keiji_otsubo/items/92f92bb9f668ca9688be)


+ [How to add fields in Recent items utility bar](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007WeBEk)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/328136/f3b7ce08-fb4f-b98a-44f0-f0f76f06013b.png)

:::note
When creating a utility bar for your app, keep these things in mind:

+ Utility bars created using the Lightning App Wizard or in the Lightning App Builder can be assigned to only one Lightning app. However, utility bars created using the API can be assigned to multiple Lightning apps.
+ The utility bar doesn’t support Visualforce pages or components.
+ The utility bar doesn’t fully support the Chatter Publisher and Feed components.
+ The History utility works in Lightning console apps only.
+ The Omni-Channel utility works in the Lightning Service Console app only.
+ The default utility bar alignment matches the user’s language setting alignment. For example, English is read left to right. If you select Default and a user’s language is set to English, the utility bar appears at the bottom of the left side of the screen. If you select Mirrored, the utility bar appears at the bottom of the right side of the screen.

https://help.salesforce.com/s/articleView?id=sf.apps_lightning_utilities.htm&type=5
:::

+ [Is it possible to hide/disable the button of minimize in the utility bar](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007aiUqVSAU)

:::note
There's no function I see for hiding the minimize option here https://developer.salesforce.com/docs/component-library/bundle/lightning:utilityBarAPI/documentation , if the minimize can be done using a button like

 
```
<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();
    }
})
```

Check [Minimize the Utility from the Button ](https://thesalesforcetutorial.blogspot.com/2024/04/minimize-utility-from-button.html)
:::


# フロー

+ [ユーティリティバーに追加した画面フローが表示されない](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007UtJkl)

:::note
フローの実行権限が必要みたいです。

URL または [設定] から起動されるフローでは、Classic ランタイム環境ではなく Lightning ランタイム環境が使用されます。Lightning ランタイムでのみ 2 列フロー画面、カスタム画面コンポーネント、ローカルアクションがサポートされます。

フローの Lightning ランタイムを有効化
設定 --> プロセスの自動化設定


And the answer is ...

+ If the only item in the Utility Bar is a Flow, and ...
+ The running user is not a Flow User (in user record) or does not have Manage Flows or Run Flows permission (in either profile or Permission Set)


Then, even if the specific flow in the Utility Bar has been granted to a Profile or Permission Set assigned to the running user, the absence of the Flow User/Manage Flows/Run Flows will prevent the Utility Bar from even displaying (as empty or with the flow).

In my use case, I needed to add the Run Flows permission to the Permission Set that granted access to the flow - thus encapsulating all the required permissions for the flow in one place. 

https://salesforce.stackexchange.com/questions/300831/utility-bar-doesnt-appear-in-lightning-app-for-certain-users
:::




# LWC

+ [How to use openTab() in a LWC placed in Utility Bar?](https://trailhead.salesforce.com/en/trailblazer-community/feed/0D54S00000FXeNH)


# トレイルヘッド

+ [Create Macros & Quick text to reduce clicks challenge](https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007JAtvw)

:::note
you should normally find macro in the following parts :

- in the Service Console application (last capture is in Service [not Service Console] app)

- in the Utility bar (in the bottom bar of the screen)
:::