fsl-inventory-management

Configure and manage Field Service Lightning inventory: ProductItem (stock at locations), ProductTransfer (stock movement), ProductConsumed (parts used on work orders), ProductRequest/ProductRequestLineItem (replenishment ordering), and ProductItemTransaction (audit trail). NOT for CPQ product catalog management, OCI (Omnichannel Inventory), or B2B Commerce warehouse integration.

Best use case

fsl-inventory-management is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Configure and manage Field Service Lightning inventory: ProductItem (stock at locations), ProductTransfer (stock movement), ProductConsumed (parts used on work orders), ProductRequest/ProductRequestLineItem (replenishment ordering), and ProductItemTransaction (audit trail). NOT for CPQ product catalog management, OCI (Omnichannel Inventory), or B2B Commerce warehouse integration.

Teams using fsl-inventory-management 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-inventory-management/SKILL.md --create-dirs "https://raw.githubusercontent.com/PranavNagrecha/AwesomeSalesforceSkills/main/skills/admin/fsl-inventory-management/SKILL.md"

Manual Installation

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

How fsl-inventory-management Compares

Feature / Agentfsl-inventory-managementStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Configure and manage Field Service Lightning inventory: ProductItem (stock at locations), ProductTransfer (stock movement), ProductConsumed (parts used on work orders), ProductRequest/ProductRequestLineItem (replenishment ordering), and ProductItemTransaction (audit trail). NOT for CPQ product catalog management, OCI (Omnichannel Inventory), or B2B Commerce warehouse integration.

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 Inventory Management

This skill activates when a practitioner needs to configure or troubleshoot the Field Service Lightning inventory object model — covering stock locations, stock movement, parts consumption on work orders, replenishment ordering, and the auto-generated audit trail. It does NOT cover CPQ product catalog configuration, OCI (Omnichannel Inventory) for B2B Commerce, or ERP warehouse integration patterns.

---

## Before Starting

Gather this context before working on anything in this domain:

- Confirm the Field Service managed package is installed and Field Service is enabled under Setup > Field Service Settings. The inventory objects (ProductItem, ProductTransfer, ProductRequest, ProductConsumed, ProductItemTransaction) are part of the FSL data model and do not exist without the package.
- Identify all Location record types in use: fixed warehouses, depots, and technician vans. Van locations must have the **Mobile Location** checkbox enabled or field technicians cannot see their own stock in the FSL mobile app.
- Confirm whether ProductItemTransaction records are being managed manually anywhere — they are auto-generated by the platform and must never be directly created or deleted. Manual DML on these records corrupts QuantityOnHand on the linked ProductItem.
- Understand the replenishment trigger: is it manual (dispatcher creates ProductRequest), threshold-based (custom automation), or driven by work order completion events?

---

## Core Concepts

### The Six Core Inventory Objects

The FSL inventory data model has six primary objects. Each has a distinct role and must not be confused with the others.

**ProductItem** — represents a quantity of a specific Product2 stored at a specific Location. `QuantityOnHand` is the live count. This is the master stock record. Do not manually update `QuantityOnHand` — it is maintained by the platform as ProductTransfer and ProductConsumed records are created and updated.

**ProductTransfer** — records the movement of stock from one Location to another (e.g., warehouse → technician van). QuantityOnHand on the source ProductItem does NOT decrease when the transfer is created. It decreases only when the transfer status is set to **Received**. This is the single most common source of incorrect inventory counts.

**ProductRequest / ProductRequestLineItem** — ProductRequest is the replenishment order header (equivalent to a purchase order request). ProductRequestLineItem is the individual line specifying which Product2, what quantity, and which destination Location. These drive the ordering workflow but do not themselves move stock — a ProductTransfer must be created when the order is fulfilled.

**ProductConsumed** — records which products and quantities were used on a specific Work Order. Creating a ProductConsumed record decrements `QuantityOnHand` on the linked ProductItem. This is the field service equivalent of "booking out" parts to a job.

**ProductItemTransaction** — an auto-generated, read-only audit record created by the platform every time QuantityOnHand on a ProductItem changes (via ProductTransfer Received or ProductConsumed). Manual DML against this object is not supported and corrupts the inventory ledger. It cannot be disabled.

**ReturnOrder / ReturnOrderLineItem** — records stock returned from a technician or customer back to a Location. Creating a ReturnOrderLineItem increments QuantityOnHand on the target ProductItem.

### Location Records and Mobile Location Flag

Every ProductItem is linked to a Location record. The Location record type controls what technicians can see:

- **Standard locations** (warehouses, depots) are visible in the Salesforce UI and accessible via API.
- **Mobile Locations** are van/truck locations used by field technicians. A Location must have `IsMobile = true` (the "Mobile Location" checkbox) to appear in the FSL mobile app inventory view. Without this flag, technicians cannot see or consume parts from that location on the mobile app, even if ProductItem records exist for it.

There is no limit enforced on how many ProductItem records a Location can have, but large product catalogs at a location should be filtered using the FSL mobile app's search rather than pre-loading everything.

### QuantityOnHand Is Platform-Managed

`QuantityOnHand` on ProductItem is a system-managed field. The platform updates it automatically when:
- A ProductTransfer linked to this ProductItem is marked **Received** (decrements source, increments destination)
- A ProductConsumed is created against a Work Order with this ProductItem as the source
- A ReturnOrderLineItem credits stock back to this ProductItem

Direct field updates to `QuantityOnHand` via Apex DML, Data Loader, or Flow are not supported. Attempting it either fails validation or produces a divergence between the ledger (ProductItemTransaction records) and the displayed count.

### No Native Cycle-Count UI

Salesforce Field Service has no native cycle-count or physical inventory reconciliation user interface. Organizations that require periodic stock counts must build a custom solution — typically a screen Flow, a custom LWC, or an external app — that compares a technician's submitted count against the current `QuantityOnHand` on each ProductItem, then creates an adjusting ProductTransfer (with a special-purpose "adjustment" location as source or destination) to reconcile the difference.

---

## Common Patterns

### Pattern 1: Van Stock Replenishment via ProductRequest and ProductTransfer

**When to use:** A field technician's van is running low on a part and needs stock transferred from a warehouse.

**How it works:**
1. A dispatcher or the technician creates a **ProductRequest** record with `DestinationLocationId` set to the technician's van Location and `ShipToStreet/City` populated if needed for shipping logistics.
2. Add one or more **ProductRequestLineItem** records specifying `Product2Id`, `QuantityRequested`, and `SourceLocationId` (the warehouse).
3. The warehouse fulfills the request by creating a **ProductTransfer** record linked to the ProductRequestLineItem, with `SourceLocationId = warehouse` and `DestinationLocationId = van`, `Quantity = fulfilled amount`.
4. When the stock physically arrives at the van, the ProductTransfer status is set to **Received**. At this moment, `QuantityOnHand` decrements on the warehouse ProductItem and increments on the van ProductItem.

**Why not the alternative:** Directly editing `QuantityOnHand` bypasses the ProductItemTransaction audit trail, violates referential integrity in the inventory ledger, and is unsupported by Salesforce.

### Pattern 2: Recording Parts Consumption on a Work Order

**When to use:** A technician uses a physical part to complete a work order and the inventory must be decremented.

**How it works:**
1. The technician (or dispatcher) creates a **ProductConsumed** record from the Work Order related list.
2. Set `WorkOrderId` (or `WorkOrderLineItemId` for WOLI-level tracking), `Product2Id`, `QuantityConsumed`, and `SourceLocationId` (the technician's van ProductItem location).
3. On save, Salesforce finds the ProductItem for that Product2 + Location combination and decrements `QuantityOnHand` by `QuantityConsumed`.
4. A **ProductItemTransaction** record is auto-generated as an audit entry.

**Why not the alternative:** Manually creating a ProductTransfer from van to a dummy "consumed" location is an anti-pattern — it generates incorrect transfer records, adds noise to the audit trail, and does not associate the consumption with the Work Order for job cost reporting.

### Pattern 3: Custom Cycle Count Reconciliation

**When to use:** Organization requires periodic physical inventory counts and needs to reconcile against system `QuantityOnHand`.

**How it works:**
1. Build a Screen Flow or custom LWC that queries ProductItem records for a given Location and displays current `QuantityOnHand` alongside a text input for the technician's physical count.
2. For each line where physical count differs from `QuantityOnHand`, calculate the delta.
3. Create a **ProductTransfer** record with a dedicated "adjustment" Location (e.g., "Inventory Adjustment Bin") as source or destination to represent the positive or negative adjustment.
4. Set the transfer status to Received immediately (or trigger a Flow to do so) to apply the QuantityOnHand correction.
5. Optionally create a custom record to log the count date, technician, and discrepancy for audit purposes.

---

## Decision Guidance

| Situation | Recommended Approach | Reason |
|---|---|---|
| Technician cannot see van stock in FSL mobile | Check Location record — enable Mobile Location (`IsMobile = true`) | Mobile app only shows IsMobile locations |
| QuantityOnHand is incorrect | Inspect ProductItemTransaction audit trail; trace which transfer or consumed record caused divergence | Do not directly edit QuantityOnHand |
| Moving stock from warehouse to van | ProductRequest + ProductRequestLineItem + ProductTransfer (Received) | Maintains full audit trail; triggers correct QuantityOnHand updates |
| Parts used on a job | ProductConsumed linked to WorkOrder + source ProductItem | Decrements stock and associates consumption to job for cost reporting |
| Stock returned from technician | ReturnOrder + ReturnOrderLineItem with destination Location | Increments QuantityOnHand on target ProductItem; maintains ledger |
| Periodic physical inventory reconciliation | Custom Screen Flow or LWC + adjusting ProductTransfer | No native cycle-count UI; ProductTransfer is the only supported adjustment mechanism |
| Investigate who consumed stock and when | Query ProductItemTransaction for the ProductItem | Auto-generated, tamper-evident audit trail |

---

## Recommended Workflow

Step-by-step instructions for configuring FSL inventory management:

1. Verify the FSL managed package is installed. Confirm Field Service is enabled under Setup > Field Service Settings. Confirm that ProductItem, ProductTransfer, ProductRequest, ProductConsumed, and ProductItemTransaction objects are present in Object Manager.
2. Create or audit all **Location** records. Each physical stocking point (warehouse, depot, technician van) needs a Location record. Set `IsMobile = true` on every van/truck location so technicians can see their own stock in the FSL mobile app.
3. Create **ProductItem** records for each Product2 at each Location where it is stocked. Set an accurate opening `QuantityOnHand` using a ProductTransfer from an "opening balance" source location (not via direct field edit). Confirm a ProductItemTransaction record was auto-created.
4. Configure **ProductRequest** and **ProductRequestLineItem** records (and any approval or notification Flow) for the replenishment workflow. Test end-to-end: create a request, fulfill it with a ProductTransfer, mark it Received, and verify QuantityOnHand updated on both source and destination ProductItems.
5. Add **ProductConsumed** records to the Work Order page layout (or verify they are already on the layout via the FSL managed package). Test: create a ProductConsumed on a work order and confirm QuantityOnHand on the van ProductItem decrements.
6. Validate the **ProductItemTransaction** trail by querying the object for a sample ProductItem and confirming every expected change (opening balance, transfers received, consumed) is represented. If records are missing or show unexpected changes, trace which DML operation caused the divergence.
7. If cycle counts are required, design and build the custom reconciliation solution (Screen Flow + adjusting ProductTransfer pattern) and document the reconciliation process for operations teams.

---

## Review Checklist

Run through these before marking work in this area complete:

- [ ] All van/truck Location records have `IsMobile = true` (Mobile Location checkbox enabled)
- [ ] ProductItem records exist for every Product2/Location combination that field technicians stock or consume
- [ ] Opening QuantityOnHand was set via ProductTransfer (Received), not via direct field edit
- [ ] ProductItemTransaction records exist and match expected audit history for all tested ProductItems
- [ ] ProductConsumed on Work Orders decrements the correct ProductItem QuantityOnHand
- [ ] ProductTransfer QuantityOnHand update fires on Received status, not on creation
- [ ] No custom Apex, Flow, or Data Loader jobs are directly writing to QuantityOnHand or ProductItemTransaction
- [ ] Replenishment workflow (ProductRequest → ProductTransfer → Received) has been end-to-end tested
- [ ] Cycle count process is documented if physical inventory reconciliation is a business requirement

---

## Salesforce-Specific Gotchas

Non-obvious platform behaviors that cause real production problems:

1. **ProductItemTransaction is Auto-Generated and Must Not Be Touched** — Every QuantityOnHand change on a ProductItem creates an auto-generated ProductItemTransaction record. Directly creating, updating, or deleting these records via Apex, Data Loader, or Flow corrupts the inventory ledger. There is no native UI or support mechanism to repair a corrupted transaction history.
2. **ProductTransfer Received — Not Created — Triggers QuantityOnHand** — QuantityOnHand on the source ProductItem does NOT decrease when a ProductTransfer is created. It decreases only when the ProductTransfer status is set to Received. Organizations that log transfers but never mark them Received end up with perpetually incorrect on-hand counts.
3. **Mobile Location Flag Is Required for Technician Visibility** — A Location record without `IsMobile = true` does not appear in the FSL mobile app inventory experience. Technicians with van stock at a standard location cannot see or consume parts from the mobile app. This setting must be set at Location creation or retroactively updated.
4. **No Native Cycle-Count UI** — Field Service Lightning has no built-in screen for recording physical inventory counts or reconciling discrepancies. Any cycle-count or auditing capability must be custom-built (Screen Flow, LWC, or external integration).
5. **ProductConsumed Source Must Match a Real ProductItem** — ProductConsumed requires a valid `SourceProductItemId` (or the combo of Product2 + Location that resolves to a ProductItem). If no ProductItem exists for the technician's current van location and the consumed product, the record creation fails. Practitioners who skip creating ProductItems for van locations encounter this failure when technicians try to log parts usage.

---

## Output Artifacts

| Artifact | Description |
|---|---|
| Location records | One per stocking point; vans flagged with IsMobile = true |
| ProductItem records | One per Product2/Location combination representing on-hand stock |
| ProductTransfer records | Movement records for stock between locations; triggers QuantityOnHand on Received |
| ProductRequest / ProductRequestLineItem | Replenishment order header and line items |
| ProductConsumed records | Parts usage linked to Work Orders for cost tracking |
| ProductItemTransaction records | Auto-generated audit trail (read-only; never hand-edited) |
| Cycle-count Flow or LWC | Custom solution for physical inventory reconciliation |
| Configuration checklist | Completed template confirming all FSL inventory objects are wired correctly |

---

## Related Skills

- `fsl-work-order-management` — for configuring the Work Order and Work Order Line Item objects that ProductConsumed records are linked to
- `fsl-mobile-app-setup` — for configuring how technicians access inventory and log parts from the FSL mobile app
- `fsl-resource-management` — for managing Location records in the context of service territories and technician assignments

---

## Official Sources Used

- Field Service Inventory Management Data Model — https://developer.salesforce.com/docs/atlas.en-us.field_service_dev.meta/field_service_dev/fsl_dev_overview_inventory.htm
- Common Field Service Inventory Tasks — https://help.salesforce.com/s/articleView?id=sf.fs_inventory.htm&type=5
- ProductItem Object Reference — https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_productitem.htm
- ProductTransfer Object Reference — https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_producttransfer.htm
- ProductConsumed Object Reference — https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_productconsumed.htm
- ProductItemTransaction Object Reference — https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_productitemtransaction.htm
- Salesforce Well-Architected Overview — https://architect.salesforce.com/docs/architect/well-architected/guide/overview.html

Related Skills

session-management-and-timeout

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when configuring session timeout values, concurrent session limits, session IP locking, or logout behavior in Salesforce. Covers org-wide session settings, profile-level overrides, Connected App session policies, and Metadata API SecuritySettings deployment. NOT for OAuth token refresh flows, login IP ranges, or MFA/identity-provider configuration.

oauth-token-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when work depends on how Salesforce OAuth access and refresh tokens are issued, refreshed, rotated, revoked, or introspected for a Connected App or API client—including unexpected logouts, invalid_grant after refresh, or designing token incident response. NOT for choosing which OAuth grant or Connected App flow to implement (use integration/oauth-flows-and-connected-apps), Named Credential packaging (use integration/named-credentials-setup), or broad Connected App IP and PKCE policy hardening without a token-lifecycle angle (use security/connected-app-security-policies).

certificate-and-key-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when creating, uploading, or rotating certificates in Salesforce, configuring mutual TLS (mTLS) client authentication, managing the Java KeyStore for CA-signed certificates, diagnosing certificate expiry in JWT OAuth flows, or understanding which certificate types Salesforce supports and how to migrate them between orgs. NOT for Named Credential configuration (use named-credentials-setup skill), NOT for Shield Platform Encryption key management. Trigger keywords: Certificate and Key Management, self-signed certificate, CA-signed certificate, mutual TLS, mTLS, keystore, JKS, PKCS12, certificate rotation, certificate expiry, JWT certificate.

flexcard-state-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when designing FlexCard actions, conditional visibility, and state that must survive navigation, refresh, or parent/child card transitions. Triggers: 'flexcard state', 'flexcard conditional visibility', 'flexcard actions', 'flexcard refresh', 'child flexcard state'. NOT for raw LWC state or for OmniScript step state.

lwc-state-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Share state across LWCs using pub/sub, Lightning Message Service, @wire, and reactive stores. NOT for in-component reactivity.

lwc-focus-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when building LWCs that need to manage focus explicitly — modal dialogs, wizard flows, dynamic inserts, list updates, error summaries, and focus after async work. Covers focus restoration, focus traps, programmatic focus across shadow DOM, and patterns for announcing changes to assistive tech. Does NOT cover general LWC a11y audit (see lwc-accessibility).

revenue-lifecycle-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when implementing or troubleshooting Salesforce Revenue Lifecycle Management (RLM) — the native Revenue Cloud product covering order-to-cash lifecycle, Dynamic Revenue Orchestrator (DRO) fulfillment plan design, asset amendments, billing schedule creation via Connect API, and invoice management. Triggers on: Dynamic Revenue Orchestrator, RLM order decomposition, DRO fulfillment swimlanes, native Revenue Cloud billing schedule, asset lifecycle management Salesforce. NOT for CPQ quoting or pricing rules (use cpq-* skills), not for the legacy Salesforce Billing managed package with blng__* objects (different product entirely), not for standard Order objects without Revenue Cloud features.

loyalty-management-setup

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when setting up or extending Salesforce Loyalty Management — including program and currency creation, tier group design, qualifying vs. non-qualifying point currency separation, DPE batch job activation, partner loyalty configuration, and member portal setup on Experience Cloud. Triggers on: Loyalty Management setup, loyalty tier setup Salesforce, qualifying points vs redemption points, DPE batch job for loyalty, partner loyalty program Salesforce, loyalty member portal. NOT for Marketing Cloud engagement program design (separate product), not for B2B loyalty via Sales Cloud (standard opportunity, not loyalty program), not for general Experience Cloud site setup (use experience-cloud-setup skill).

scratch-org-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use this skill when designing, configuring, or troubleshooting scratch orgs: definition file structure, edition selection, allocation limits, Org Shape, CI automation via ScratchOrgInfo, and lifecycle management from the Dev Hub. NOT for SFDX CLI basics (use sf-cli-and-sfdx-essentials), sandbox management, or production org administration.

release-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when planning, coordinating, or governing Salesforce releases: version numbering, rollback strategy, release notes, go/no-go criteria, release calendar, and sandbox preview alignment. NOT for deployment mechanics (use devops/post-deployment-validation or devops/change-set-deployment).

pipeline-secrets-management

8
from PranavNagrecha/AwesomeSalesforceSkills

Store and inject Salesforce auth URLs, JWT keys, and API credentials into CI without leaking them. NOT for runtime secrets in Apex.

isv-license-management-and-trialforce

8
from PranavNagrecha/AwesomeSalesforceSkills

Use when an ISV partner is wiring license enforcement, trial provisioning, or feature-flag distribution into a managed package — covers License Management App (LMA) install and registration, Lead/License object lifecycle, Trialforce Management Org (TMO) and Trialforce Source Org (TSO) split, Trialforce templates, SignupRequest API, AppExchange Checkout integration, and Feature Parameters (LmoToSubscriber / SubscriberToLmo) as the cross-org configuration channel. Triggers: 'register package with LMA', 'set up Trialforce', 'add feature parameter to managed package', 'license expired in subscriber org', 'AppExchange Checkout licensing'. NOT for general managed-package version creation, ancestor pinning, or PostInstall handler design (use managed-package-development); NOT for second-generation packaging mechanics (use second-generation-managed-packages); NOT for non-ISV experience-cloud login licensing (use experience-cloud-licensing-model).