I have three objects ObjectA, ObjectB, ObjectC. ObjectA is the grand parent, ObjectB is child of A & Object C is child of B. I'm providing a button on ObjectA page layout to create/edit records for objectB & ObjectC.
I have a page in which the user can perform the operations for child objects B &C.
User can insert/update record for Object 1, insert/update/add attachment for Object 2.
Both the object operations are shown in two different page block and operations for ObjectC should appear only after ObjectB updates.
Here, the problem is I want to set the savepoint on page load & if the user cancel the operation in any page block, I should rollback all the DML operations done so far and then redirect to ObjectA page detail.
How can I achieve this?