How does Asset tracking connect to Work Orders in Salesforce Field Service to give maintenance history, and how do you query repeat failures?
Answer
Work Orders are linked to Assets, so every visit becomes part of that equipment's history.
How it works
- The Work Order has an Asset lookup (and Work Order Line Items can point to assets too).
- On the Asset record, the related list shows all past Work Orders, parts used and outcomes.
- Technicians see the history in the mobile app before they arrive.
- Maintenance Plans, Warranties and Service Contracts attach to the same asset.
Business value
- Faster diagnosis, because the technician knows previous faults.
- Spotting repeat failures and problem models.
- Correct warranty and billing decisions.
soql
SELECT Id, WorkOrderNumber, Subject, Status, EndDate
FROM WorkOrder
WHERE AssetId = :assetId
ORDER BY CreatedDate DESC
LIMIT 20
Find assets with repeated visits:
soql
SELECT AssetId, COUNT(Id) visits
FROM WorkOrder
WHERE CreatedDate = LAST_N_DAYS:90 AND AssetId != null
GROUP BY AssetId
HAVING COUNT(Id) > 2
AssetWork OrderService HistorySOQL