Skip to main content

Hi Trailblazers,

In our Salesforce application, we have an LWC that displays records and provides configurable action buttons. Based on the selected action, we need to invoke a Screen Flow, another LWC, or an Aura component.

Currently, we use Lightning Message Service (LMS) to communicate with a separate helper component that is placed on the Lightning record page. The helper component receives the message and handles the corresponding action.

We would like to simplify this architecture by removing both LMS and the helper component.

My questions are:

  1. Can we launch a Screen Flow directly from our existing LWC using lightning-flow, without LMS or a helper component?
  2. Can we invoke or display another LWC directly from our existing LWC based on a configurable action?
  3. Can we invoke an Aura component directly from an LWC without using a helper component?
  4. Is there a recommended Salesforce architecture to support all three types of actions dynamically from a single LWC action button?

Our requirement is to support configurable actions rather than hardcoding each target component.

I understand that the approach may differ for Flow, LWC, and Aura components. I would appreciate any recommendations, limitations, or best practices for achieving this without LMS and a separately placed helper component.

Thanks in advance! 

 

#Salesforce Developer

1 个回答
  1. 10月29日 18:48

    Hi Parthasarathi, you can launch Screen Flows directly with lightning-flow, and for other LWCs you could use dynamic components with lwc. Aura is the tricky part since you can't embed it directly inside an LWC. I'd use a small action registry to map each button to its target, and handle Aura separately through navigation if possible.

0/9000