fsl-custom-actions-mobile

Use this skill when building custom LWC actions for the FSL Mobile app: barcode scanning, GPS capture, photo/signature capture, or custom guided workflows on mobile. Trigger keywords: FSL Mobile custom action, lightning__GlobalAction FSL, barcode scanner LWC, mobileCapabilities, Nimbus plugin, FSL lightning SDK. NOT for standard Salesforce Mobile App quick actions, standard Experience Cloud pages, or desktop Lightning Experience LWC components.

Best use case

fsl-custom-actions-mobile is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use this skill when building custom LWC actions for the FSL Mobile app: barcode scanning, GPS capture, photo/signature capture, or custom guided workflows on mobile. Trigger keywords: FSL Mobile custom action, lightning__GlobalAction FSL, barcode scanner LWC, mobileCapabilities, Nimbus plugin, FSL lightning SDK. NOT for standard Salesforce Mobile App quick actions, standard Experience Cloud pages, or desktop Lightning Experience LWC components.

Teams using fsl-custom-actions-mobile should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/fsl-custom-actions-mobile/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/apex/fsl-custom-actions-mobile/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/fsl-custom-actions-mobile/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How fsl-custom-actions-mobile Compares

Feature / Agentfsl-custom-actions-mobileStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this skill when building custom LWC actions for the FSL Mobile app: barcode scanning, GPS capture, photo/signature capture, or custom guided workflows on mobile. Trigger keywords: FSL Mobile custom action, lightning__GlobalAction FSL, barcode scanner LWC, mobileCapabilities, Nimbus plugin, FSL lightning SDK. NOT for standard Salesforce Mobile App quick actions, standard Experience Cloud pages, or desktop Lightning Experience LWC components.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# FSL Custom Actions Mobile

This skill activates when a developer needs to build custom LWC actions that run inside the FSL Mobile app — including barcode scanning, GPS-based actions, photo capture, and guided work flows. It covers the Lightning SDK for FSL Mobile, the Nimbus plugin device API, and the critical deployment constraints that differ from standard Lightning Experience LWC development.

---

## Before Starting

Gather this context before working on anything in this domain:

- Confirm the `Enable Lightning SDK for FSL Mobile` permission set is assigned to all technician users. Without it, custom LWC actions silently fail to load in FSL Mobile even if page layout configuration is correct.
- Determine the action scope: `lightning__GlobalAction` (available from the app-level action bar — not tied to a specific record) or `lightning__RecordAction` (surfaced on a specific object's record page, e.g., Work Order). The targets have different page layout configuration paths.
- Identify which device capabilities are needed. All Nimbus plugin calls must be gated with `isAvailable()` before invocation — calling without availability check throws on devices or simulators where the capability is absent.
- Check whether the org uses the legacy HTML5 Mobile Extension Toolkit. The LWC-based Lightning SDK model is separate and not interchangeable with the legacy toolkit.

---

## Core Concepts

### Lightning SDK for FSL Mobile

The Lightning SDK is the framework that enables custom LWC components to run natively inside the FSL Mobile app (iOS and Android). Components authored for the Lightning SDK use standard LWC syntax but gain access to device-level capabilities via Nimbus plugins — the bridge between JavaScript and native device APIs.

**Critical constraint:** Components with `lightning__GlobalAction` target render ONLY in FSL Mobile. They do not render in the standard Lightning Experience desktop, the standard Salesforce Mobile App, or Experience Cloud. Developers who test a `lightning__GlobalAction` LWC in the desktop browser will see it in the page layout configuration but it will not function in the mobile app without the permission set and correct app configuration.

### Nimbus Plugins — Device Capability Bridge

Nimbus plugins expose native device APIs to LWC JavaScript:

| Plugin Import | Capability |
|---|---|
| `lightning/mobileCapabilities` | Meta-module — use to get specific plugins |
| `getBarcodeScanner()` | Barcode and QR code scanning |
| `getLocationService()` | GPS coordinates |
| `getCameraCapture()` | Photo capture |

**Availability gate (mandatory):** Every Nimbus plugin must be checked with `isAvailable()` before calling its methods. On desktop or when the permission set is missing, the plugin returns null and calling methods on null throws immediately.

```javascript
import { getBarcodeScanner } from 'lightning/mobileCapabilities';
const scanner = getBarcodeScanner();
if (scanner == null || !scanner.isAvailable()) {
    // Show disabled state or fallback
    return;
}
```

### Action Target Configuration

- `lightning__GlobalAction`: Added to the FSL Mobile app's global action set in Setup > Apps > App Manager > FSL Mobile App. Appears in the mobile app's "+" action bar.
- `lightning__RecordAction`: Added to the page layout of a specific object (e.g., Work Order). Appears in the record's action panel in FSL Mobile.

Both require the component to declare the correct `targets` in its `.js-meta.xml` metadata.

---

## Common Patterns

### Barcode Scan Action

**When to use:** Technician needs to scan a product barcode to look up a part or confirm a serial number during a work order.

**How it works:**

```javascript
// barcodeScanAction.js
import { LightningElement } from 'lwc';
import { getBarcodeScanner } from 'lightning/mobileCapabilities';

export default class BarcodeScanAction extends LightningElement {
    scanner;
    scannedCode = '';

    connectedCallback() {
        this.scanner = getBarcodeScanner();
    }

    get isScanAvailable() {
        return this.scanner != null && this.scanner.isAvailable();
    }

    handleScan() {
        if (!this.isScanAvailable) {
            return; // show error toast in real implementation
        }
        this.scanner.beginCapture({
            barcodeTypes: [this.scanner.BARCODE_TYPE_CODE128, this.scanner.BARCODE_TYPE_QR]
        }).then(result => {
            this.scannedCode = result.value;
            this.scanner.endCapture();
        }).catch(err => {
            this.scanner.endCapture();
        });
    }
}
```

**Why not HTML input:** Camera-based HTML5 input doesn't integrate with the device's native barcode scanning engine and produces unreliable results in field conditions.

### GPS Location Capture

**When to use:** Technician needs to stamp GPS coordinates on arrival at a job site.

**How it works:**

```javascript
import { getLocationService } from 'lightning/mobileCapabilities';

connectedCallback() {
    const locationService = getLocationService();
    if (locationService != null && locationService.isAvailable()) {
        locationService.getCurrentPosition({
            enableHighAccuracy: true,
            timeout: 10000
        }).then(result => {
            const lat = result.coords.latitude;
            const lng = result.coords.longitude;
            // Update record via Apex or wire
        });
    }
}
```

---

## Decision Guidance

| Situation | Recommended Approach | Reason |
|---|---|---|
| Action from main mobile nav | `lightning__GlobalAction` + App Manager | App-level, not tied to a record |
| Action on Work Order record | `lightning__RecordAction` + page layout | Record-scoped |
| Barcode scanning | `getBarcodeScanner()` with `isAvailable()` guard | Native barcode integration |
| GPS stamp | `getLocationService()` with high accuracy | Device GPS vs. browser geolocation |
| Photo documentation | `getCameraCapture()` Nimbus plugin | Native camera via Nimbus |
| Testing on desktop | Guard with `isAvailable()` = false, show fallback UI | Desktop has no Nimbus bridge |

---

## Recommended Workflow

Step-by-step instructions for an AI agent or practitioner working on this task:

1. **Confirm `Enable Lightning SDK for FSL Mobile` permission set** — Assign to all FSL Mobile users before attempting any deployment or testing. Missing this causes silent failure.
2. **Choose and declare action target** — Set `lightning__GlobalAction` or `lightning__RecordAction` in the LWC's `.js-meta.xml` `<targets>` section.
3. **Import and guard Nimbus plugins** — Import the required plugin from `lightning/mobileCapabilities`. Check `isAvailable()` before any device capability call. Build a visible fallback for desktop/non-supported contexts.
4. **Configure in Setup** — For `lightning__GlobalAction`: App Manager > FSL Mobile App > Action Bar. For `lightning__RecordAction`: page layout editor for the target object.
5. **Test on a physical FSL Mobile device** — Desktop browser testing will not invoke Nimbus plugins. Use a real iOS/Android device with FSL Mobile installed and permission set assigned.
6. **Handle offline behavior** — Verify action behavior when the device is offline; FSL Mobile's briefcase sync controls which records are available offline, not the LWC itself.

---

## Review Checklist

- [ ] `Enable Lightning SDK for FSL Mobile` permission set assigned to target users
- [ ] `targets` in `.js-meta.xml` includes the correct target type
- [ ] All Nimbus plugin calls gated with `isAvailable()` check
- [ ] Fallback UI implemented for non-FSL-Mobile context
- [ ] Action added to correct location in Setup
- [ ] Tested on physical device with FSL Mobile app installed
- [ ] Offline behavior understood

---

## Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

1. **`lightning__GlobalAction` components do NOT render in Lightning Experience desktop or standard Salesforce Mobile App** — They only appear in FSL Mobile. Testing on desktop appears to work in configuration but produces no visible component for users.
2. **Missing permission set causes silent load failure** — No error is displayed to the technician. The action simply does not appear. Always verify the permission set before troubleshooting component code.
3. **Nimbus plugin returns null on desktop** — `getBarcodeScanner()` returns null in standard Lightning Experience. Calling `.beginCapture()` on null throws immediately. The `isAvailable()` guard is mandatory, not optional.
4. **Legacy HTML5 Mobile Extension Toolkit and LWC are not interchangeable** — Components built with the old toolkit require a full rewrite to use Nimbus plugins. Do not mix configuration from both models in the same org.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| LWC component with Nimbus integration | JavaScript + HTML + XML metadata with correct target and Nimbus availability guard |
| Permission set assignment checklist | Permission sets required for FSL Mobile custom actions |

---

## Related Skills

- apex/fsl-apex-extensions — Broader FSL Apex namespace and SDK patterns
- architect/fsl-offline-architecture — Offline data priming and sync behavior affecting custom action data access

Related Skills

customer-data-request-workflow

8
from PranavNagrecha/AwesomeSalesforceSkills

Implement GDPR/CCPA data subject rights (access, deletion, rectification) using Salesforce Privacy Center and/or custom workflow. NOT for general backup or org-level data retention policy.

omnistudio-remote-actions

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when configuring, troubleshooting, or choosing between Remote Action types in OmniScript or FlexCard. Triggers: 'remote action', 'OmniScript action', 'IP action', 'Apex action element', 'VlocityOpenInterface2', 'Send/Response JSON Path'. NOT for Integration Procedure internal design (use integration-procedures) or generic Apex callout patterns (use apex integration skills).

omnistudio-custom-lwc-elements

8
from PranavNagrecha/AwesomeSalesforceSkills

Creating and integrating custom Lightning Web Components within OmniScripts: LWC override patterns, pubsub event handling, custom validation, OmniStudio data passing conventions. Use when a standard OmniScript element cannot meet a UX requirement. NOT for standalone LWC development (use lwc/* skills). NOT for Integration Procedures (use integration-procedures). NOT for embedding an OmniScript inside an LWC (use omnistudio-lwc-integration).

lwc-quick-actions

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building a Lightning Web Component that runs from a record page quick-action button — either a screen action that renders UI in a modal or a headless action that invokes logic with no UI. Triggers: 'lwc quick action on record page', 'headless quick action no ui', 'closeactionscreenevent not working', 'how to pass recordid into quick action lwc', 'quick action vs flow action', 'quick action modal size'. NOT for Flow screen components — use `lwc-in-flow-screens` — and NOT for global actions without a record context or for list-view bulk actions that do not receive a single `recordId`.

lwc-offline-and-mobile

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing or reviewing Lightning Web Components for the Salesforce mobile app, mobile device capabilities, or offline-aware behavior. Triggers: 'lightning/mobileCapabilities', 'mobile lwc', 'offline lwc', 'supported mobile app only', 'barcode scanner availability'. NOT for Mobile SDK or fully native app architecture unless the decision is whether LWC in the Salesforce mobile app is sufficient.

lwc-mobile-offline-and-briefcase

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing LWCs that must work offline in the standard Salesforce Mobile App, and when configuring Briefcase Builder rules to prime records onto user devices. Covers form-factor detection (`@salesforce/client/formFactor`), Lightning Data Service offline-cache behavior, Briefcase priming-rule design, conflict resolution on reconnect, and the legacy SmartStore / IndexedDB picture for context. Triggers: 'briefcase builder rule design', 'lwc not working offline', 'how do I prime records to user devices', 'sync conflict on reconnect', 'offline draft persistence in lwc'. NOT for Field Service Mobile offline priming (use admin/fsl-mobile-app-setup or architect/fsl-offline-architecture — FSL has its own priming pipeline). NOT for general LWC mobile container patterns / device APIs (use lwc/lwc-offline-and-mobile).

lwc-custom-lookup

8
from PranavNagrecha/AwesomeSalesforceSkills

Custom lookup component in LWC — typeahead/autocomplete that searches records via Apex SOSL/SOQL, shows pills, supports keyboard navigation, and manages open/close state. Use when lightning-input-field or lightning-record-picker won't work (cross-org search, computed filters, custom result rendering). NOT for in-form lookups inside lightning-record-edit-form (use lightning-input-field) or lookup filters (use admin lookup filter config).

lwc-custom-event-patterns

8
from PranavNagrecha/AwesomeSalesforceSkills

When and how to design CustomEvent traffic out of an LWC — bubbles / composed / cancelable flag choices, detail payload shape, naming rules, and propagation control. Trigger keywords: 'event not reaching parent', 'composed shadow DOM', 'CustomEvent detail mutation', 'stopPropagation vs stopImmediatePropagation'. NOT for parent-to-child communication (use `@api` — see `lwc/component-communication`), NOT for sibling fan-out (use Lightning Message Service — see `lwc/lightning-message-service`), NOT for wire-service data plumbing.

lwc-custom-datatable-types

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when you need to extend `lightning-datatable` with custom cell renderings: status pills, progress bars, image thumbnails, action cells, editable pickliststo, rich-text, or any column that `lightning-datatable` does not ship out of the box. Triggers: 'custom cell type lightning datatable', 'progress bar column', 'image column', 'inline edit picklist in datatable', 'rich text column'. NOT for basic datatable usage (see `lwc-data-table`) and NOT for tree-grid or large-dataset virtualization (see `virtualized-lists`).

experience-cloud-search-customization

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring or extending search on an Experience Cloud site — covering Search Manager scope configuration, LWR vs Aura search component selection, federated search setup, guest user search access, and custom search result components. NOT for SOSL/SOQL query development. NOT for internal Salesforce global search or Einstein Search for agents.

custom-property-editor-for-flow

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building or reviewing an LWC Custom Property Editor for Flow screen or action configuration, including the `configurationEditor` metadata hook, builder-side APIs, validation, and value-change events. Triggers: 'custom property editor', 'Flow configuration editor', 'builderContext', 'inputVariables', 'configurationEditor'. NOT for ordinary runtime screen-component behavior when no Flow Builder design-time customization is involved.

flow-custom-property-editors

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing or reviewing Flow custom property editor patterns for screen components or actions, including when Flow Builder needs guided design-time configuration, generic type mapping, or builder-context-aware validation. Triggers: 'Flow custom property editor', 'configurationEditor', 'builderContext', 'inputVariables', 'Flow screen component setup'. NOT for general LWC runtime behavior when Flow Builder customization is not involved.