Loading

LWC Component Variables appearing as "Undefined" in Field Service Mobile App

Date de publication: May 20, 2026
Description

A custom Lightning Web Component (LWC) used for image capture and data overlay displays undefined for certain fields (e.g., Beneficiary Name, Address, ID) when used on the Field Service Mobile App.
 

  • Desktop Behavior: The same component works perfectly, and all fields populate correctly.

  • Mobile Behavior: Fields sourced from related records or lookups appear as undefined on the captured image/record.

  • Global Variables: Latitude, Longitude, and Timestamps populate correctly on both platforms.

Résolution

Cause

The issue is caused by a combination of Mobile Metadata Caching and Data Visibility constraints specific to the FSL Mobile offline prime engine:

    1. Missing Lookup Fields: If a lookup field (e.g., Beneficiary__c) is not present on the Page Layout assigned to the mobile user, the mobile app does not prime the related record's data into the local offline database.

    2. Record Sharing: Even if the field is on the layout, the mobile user must have explicit sharing access to the related record (the "Beneficiary" record) for the Apex controller to retrieve the data while offline or during a mobile sync.


Step 1: Update Mobile Page Layouts

The FSL Mobile app uses the Page Layout to determine which records to "prime" (download) for offline use.

  1. Navigate to Setup > Object Manager > Service Appointment.

  2. Locate the Page Layout assigned to the Technician/Service Resource profile.

  3. Ensure the Lookup Field to the related object (e.g., Beneficiary__c) is added to the layout.

  4. Ensure any fields being used by the LWC are also present on the layout.

Step 2: Configure Record Sharing

Ensure the Mobile User has "Read" access to the related records.

  1. Check Organization-Wide Defaults (OWD) for the related object (Beneficiary).

  2. If Private, implement Sharing Rules based on Roles, Public Groups, or Manager Hierarchies to ensure the technician owns or is shared the records related to their Service Appointments.

  3. Validation: Test by providing Manual Sharing to a specific record for the affected user to see if the data appears.

Step 3: Refresh Mobile App

For the changes to take effect on the mobile device:

  1. In the FSL Mobile App, navigate to Settings > Advanced Settings.

  2. Select Clear Cached Metadata.

  3. Close the app completely (swipe up from the app switcher) and re-open it.

  4. Allow the Initial Sync to complete fully before testing the image capture.
     

Numéro d’article de la base de connaissances

005316355

 
Chargement
Salesforce Help | Article