what I am trying to achieve is whenever a "Partner" field is changed, it should get reflected in Opportunity Team and Opportunity Split. Meaning that When a "Partner" field in opportunity is changed to Null, Opportunity Split and Team should also show only one opportunity team member (opportunity owner)
Another complication I face is whenever a opportunity owner is changed with "Partner" field not empty, if we check keep opportunity team we have 3 opportunity team, one including the prior owner, but if we do not check that keep opportunity team checkbox we lose the one from the "Partner" field.
Have achieved some of it but its not complete.
I have accomplished this without using loop. but it produces error when user manually creates opp. team members and split owner. I wanted to use loop. but I do not have clear understanding from where to take back the return loop as I am not just creating one record but 2 records in Opp. team member and opp. split and delete as well.
Now the question is Do I need a loop for this use case
(I am not good with loops)? How would be the best way to solve this issue?