Newer Version Available

This content describes an older version of this product. View Latest

General Considerations

Consider these general details when planning your Lightning web components development efforts.
  • Salesforce mobile apps can only perform operations on known records, and for record creation, object metadata is required.

    In online scenarios, mobile apps can fetch missing data as needed. However, in offline scenarios, creating new records or performing operations on existing record data is restricted to the data already present in the app, such as object metadata.

    While specific Salesforce mobile apps may have slight variations, this outlines the recommended approach for managing Salesforce data offline.

    Note

    If your workflow involves other applications that also interact with Salesforce data, it's crucial to ensure that the latest data changes are synced with Salesforce mobile applications before using them offline.

  • The Lightning Web Components framework includes a wide range of built-in components, a number of modules that enable features, and a range of wire adapters for data access. The implementation available in LWC Offline supports a subset of these features. See additional details elsewhere in this guide.
  • Use the if:true and if:false directives to ensure your mobile offline components are properly primed when being used.
  • You can only use Lightning web components that are used as global or object-specific quick actions.
  • Object-specific quick actions can only be added to record detail pages.
  • Your components must be Lightning web components.
    • You can’t use Aura-based Lightning components, despite the similar name.
    • You can’t use Visualforce at all with Lightning web components.
     
  • Headless quick actions aren’t supported at this time.
  • Deep links to quick actions are supported. Deep links to global quick actions aren’t supported at this time.
  • To work offline, your custom components must be statically analyzable by the Salesforce service so that they can be preloaded before going offline. See Offline Environment Details for details.
  • Calling alert() from JavaScript in a Lightning web component is unsupported. It’s also an anti-pattern in Lightning web components. For debugging and logging, use console.log() and console.error(). Better yet, use Chrome DevTools or Safari Web Inspector. 
  • For user-facing messages, the correct pattern is to use a toast message. However, support for the lightning/platformShowToastEvent module is incomplete. Use LightningAlert instead.
  • Lightning web components perform minimal validations while offline. It’s possible for a record to be changed, or a new record created, which passes local validation while offline. However, it’s possible for this record to subsequently fail server-side validation when the draft record is uploaded. Record drafts that fail server-side validation block the offline queue and prevent record changes from uploading. Manually clear the invalid record to unblock the queue.
  • Depending on context, it can be unclear which field of a draft record has failed server-side validation.
  • Some Lightning web components don’t render properly due to incorrect form factor detection in certain circumstances. See the known issues in Modules Support for details.
  • A maximum of 50 records are fetched for each related list. The list size indicator — for example, “(50+)” — reflects the number of records downloaded to the app, not the number of records that exist. This limit will be customizable in a future release.