Loading

LWC Action Limitations on Salesforce Mobile App

Publish Date: May 27, 2026
Description

LWC buttons and components used as Lightning Quick Actions or embedded on record pages are subject to several constraints in the Salesforce mobile app:

  • No mobile-specific interface implementation by default. LWC components that do not implement force:lightningQuickAction or force:lightningQuickActionWithoutHeader cannot surface in the mobile action bar. Even when implemented, layout and behavior may differ from desktop.
  • lightning-datatable is not supported on mobile. This component is not responsive and commonly causes truncated columns, broken layouts, or missing data on small screens.
  • Button layout does not auto-adapt for touch. Designs using slds-grid_align-end or side-by-side button arrangements can feel cramped or be difficult to tap on small screens. Mobile-friendly layouts require full-width or spread buttons (slds-grid_align-spread).
  • CloseActionScreenEvent may behave inconsistently. On certain Android device/OS combinations, dispatching CloseActionScreenEvent from inside an LWC Quick Action can result in a blank screen instead of properly dismissing the modal.
  • Missing or inconsistent rendering. LWC buttons visible in Lightning Experience on desktop may not appear in the mobile app if the component is not properly configured for mobile page layouts or action bars.
  • External API calls and third-party JS libraries in connectedCallback or renderedCallback can silently fail on mobile, causing the component to not render.


Resolution

Recommended Solution: Screen Flow with Invocable Apex

The Salesforce-recommended pattern for mobile-compatible button-triggered actions is to use a Screen Flow that calls Invocable Apex. This pattern is natively supported in the Salesforce mobile app and avoids the rendering and interface limitations of custom LWC components.

Why This Pattern Works on Mobile

  • Screen Flows run inside the standard Salesforce mobile app wrapper without UI compatibility issues.
  • The mobile app's built-in Flow runtime handles layout, navigation, and touch events automatically.
  • Invocable Apex handles all server-side logic (DML, queries, calculations) keeping the Flow declarative while retaining full Apex capability.
  • Flow Actions (Global and Object-Specific) are surfaced in the mobile action bar exactly like standard actions — no custom interface implementation required.

    Implementation Steps

    Step 1 — Create an Invocable Apex Class

    Write an Apex class with a method annotated @InvocableMethod. This method will be called by the Flow and can accept record IDs, perform DML, and return results.
    public class MyInvocableAction {
    @InvocableMethod(label='My Action Label' description='Performs the custom action')
    public static List<Result> execute(List<Request> requests) {
    List<Result> results = new List<Result>();
    for (Request req : requests) {
    // Apex logic here (queries, DML, etc.)
    Result r = new Result();
    r.message = 'Success';
    results.add(r);
    }
    return results;
    }

    public class Request {
    @InvocableVariable(required=true)
    public Id recordId;
    }

    public class Result {
    @InvocableVariable
    public String message;
    }
    }

    Step 2 — Build a Screen Flow

    1. In Setup, go to Flow Builder and create a new Screen Flow.
    2. Add a Screen element for any user input needed (optional — omit if the action is headless).
    3. Add an Action element and select your Invocable Apex method under Apex Action.
    4. Map the {!$Record.Id} or Flow input variable to the recordId input on the Apex action.
    5. Add a final Screen element to display a success or result message (optional).
    6. Save and activate the Flow.

    Step 3 — Create a Quick Action

    1. Go to Object Manager → select your object → Buttons, Links, and ActionsNew Action.
    2. Set Action Type to Flow.
    3. Select your Screen Flow.
    4. Assign a Label and Name, then save.

    Step 4 — Add the Action to the Mobile Layout

    1. In Object ManagerPage Layouts, edit the relevant layout.
    2. In the Salesforce Mobile and Lightning Experience Actions section, add your new Flow action.
    3. Save the layout.
    4. Verify the action appears in the Actions section of the record page in the Salesforce mobile app.


      Aura Component Alternative (Legacy)

      If the customer's existing implementation uses an LWC that cannot be immediately replaced, a short-term workaround is to wrap the LWC inside an Aura component that implements force:lightningQuickAction or force:lightningQuickActionWithoutHeader, then nest the LWC inside the Aura wrapper.
      This approach surfaces the action in the mobile action bar but does not resolve underlying layout or rendering issues within the LWC itself. The Flow + Invocable Apex pattern remains the preferred long-term solution.

    Mobile-Compatible LWC Components (When LWC Is Required)

    If the use case genuinely requires LWC on mobile, the following components are fully supported:

    lightning-input✅ SupportedHandles focus and keyboard events correctly on iOS
    lightning-record-edit-form✅ SupportedRespects field-level security; no custom keyboard handling needed
    lightning-card✅ SupportedCard-based layout preferred over grid/table for mobile UX
    lightning-datatable❌ Not supportedNot responsive; causes display issues on small screens
    lightning-map⚠️ LimitedExternal API calls in lifecycle hooks may silently fail on mobile

    NOTE : LWC components are not inherently unsupported in mobile, but they require deliberate mobile-first design. Without it, users commonly experience rendering failures, missing buttons, or non-functional actions.
Knowledge Article Number

005385556

 
Loading
Salesforce Help | Article