Salesforce Fact #944 | Getting record id in utility bar LWC
If we have an LWC component in the utility bar, we can get record id in the context of a record detail page. For this, we need to check if CurrentPageReference type is standard__recordPage. Reference: https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_js_lightning_utility_bar_page_context.htm