Hello Yamini Dhanasekaran,
Follow the steps;
- Create a self association (1-*).
- Retrieve the primary object and list of secondary object.
- Create a loop and pass secondary object list.
- Use change object for Iterator object and set association value as primary object
- commit the list of secondary object.
Hope my answer helps. Reach me out for any queries.