What is the purpose of Work Order Status field? I want the Work Order status to be automatically completed, if all the Service Appointments of that Work Order are completed. How to configure this? Thanks.
You could update the Work Order status value using a trigger on the Service Appointment object -- When a Service Appointment is updated, get its Work Order, get all its sibling Service Appointment records, loop through all Service Appointment records, and, if necessary, update the Work Order status.
I wouldn't go that route though.
You can do the same thing with Visual Flow, without writing any code. There's a very good post here that goes into detail, but that should give you the basic idea:
Give it a try, and if you get stuck, post what you have here so we can help you out.
Flow and triggers are both options. I wold argue that Process Builder is an option with much less effort involved.
- Create a PB on the SA to run when SA status is set to 'Completed'
- In the PB, set the action to be performed to update the related record status (in this case, the WO).
- Done and done!