Validation for Completion
Validation Rules
Basic validation is to ensure that the activity has all the necessary information to be completed.
All pending service histories must be completed when completing the activity (mandatory).
Required service histories must be entered for worked assets.
For each asset that worked, loop through the list of required service history types defined on the activity.
Find all service histories in the list of activity service histories that its service history type = current service history type being processed and either asset ID = empty or equal current asset being processed.
If not found, issue an error that “A service history of type %1 is missing for asset %2”.