Did a bunch of multi-object validation in Apex, which is tricky when it needs to work whenever one of the records is edited, not just within a Visualforce page.
- You can't upsert records of different sobject types in a single DML operation; you have to separate inserts and updates
- If a change to either a parent or child record can cause validation to fail
- Parent and child need to be updated in the same DML operation, and then validated in
after insert/update
triggers - Child needs to be inserted before parent is updated if parent requires the existence of child
- Parent and child need to be updated in the same DML operation, and then validated in