Activity Forums Salesforce® Discussions How can we achieve conditional rollback on saving multiple hierarchy records ?

  • How can we achieve conditional rollback on saving multiple hierarchy records ?

    Posted by Vikas Kumar on February 13, 2017 at 2:19 pm

    Hi All,

    i am in a scenerio i wanted to save records based on condition like we have 5 objects

    on failure of obj5 records upto 4 get saved,

    similarly on failure of obj4 records upto 3 get saved,

    and so on ,

    but on failure of obj2, obj1 record  will not get saved

    thanks

    Kumar replied 7 years, 10 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kumar

    Member
    February 14, 2017 at 2:51 pm

    Hi Vikas,

    You can look into database.savepoint and database.rollback in Salesforce.

    Refer to this link for more info.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos