# How does Field Service inventory management track spare parts consumption across mobile work orders?

**Topic:** Service Cloud · **Difficulty:** Medium · **Tags:** Service Cloud, Field Service, Inventory Management

Read it on the site: https://www.forcechallenges.com/interview-questions/how-does-field-service-inventory-management-track-spare-parts-consumption-across-mobile-work-orders

## Answer

**Basics:** Technicians need the right part on the van. Inventory management tells you what each van and warehouse holds, what a job needs, what was used, and what must be replenished.

**How it works:**
1. Create Locations (type Warehouse, Van, Site) with Inventory Location enabled; associate a van Location with the technician's Service Resource.
2. Create ProductItem records (Product2 at a Location) with QuantityOnHand.
3. On the Work Order, add ProductRequired for expected parts.
4. The technician records ProductConsumed (with the ProductItem and QuantityConsumed), which reduces on-hand quantity.
5. Use ProductRequest and ProductRequestLineItem to request parts, ProductTransfer to move stock between locations, and ReturnOrder for returns; each change writes ProductItemTransaction records.

**Advanced / deep dive:** ProductItem transactions give the audit history for reconciliation. Serialized products use serial numbers (SerializedProduct) for traceability and warranty. Replenishment is typically a process: scheduled Flow or Apex compares QuantityOnHand with a reorder threshold and creates ProductRequests. Field Service is not a full inventory/ERP system, so integrate with ERP for purchasing and costing. Mobile: technicians can create ProductConsumed offline, so conflicts occur if stock was adjusted centrally; design reconciliation. Performance: in large orgs, index ProductItem queries by LocationId and Product2Id.

**Code / config example:**
```apex
// Record parts consumed for a work order (bulk-safe)
List<ProductConsumed> used = new List<ProductConsumed>();
for (ProductItem pi : [SELECT Id FROM ProductItem WHERE Id IN :itemIds]) {
  used.add(new ProductConsumed(WorkOrderId = woId, ProductItemId = pi.Id, QuantityConsumed = 1));
}
insert used; // decrements ProductItem.QuantityOnHand and logs ProductItemTransaction
```

**Hidden gotchas & must-remember points:**
- ProductItems can only exist at Locations marked as inventory locations.
- QuantityOnHand is system-managed through transactions, so avoid editing it directly outside adjustments.
- Consuming more than available stock may be blocked depending on settings; check behavior in your org.
- Van Location must be linked to the ServiceResource for the mobile app to show it.
- Not a replacement for ERP purchasing and valuation.

**Best practice:** Automate replenishment requests from reorder thresholds and reconcile van stock regularly.

---
Source: ForceChallenges · last updated 2026-11-02
