Merge Objects

Hi,  I have to merge 2 or 3 objects from the same entity and in that one object should be primary and others should be secondary. Those secondary objects should associate to that primary one. Thanks in advance.
1 answers

Hello Yamini Dhanasekaran,

Follow the steps;

  1. Create a self association (1-*).
  2. Retrieve the primary object and list of secondary object.
  3. Create a loop and pass secondary object list.
  4. Use change object for Iterator object and set association value as primary object
  5. commit the list of secondary object.


Hope my answer helps. Reach me out for any queries.