I'm exploring Apex and I'd like to know the best approach to accomplish the following scenario:
Given a list of records, each having name and position (increment), I want once I update the position of a record the other records update themselves.
Example: a 1, b 2, c 3, d 4, e 5
I want to update D and set it to 2, so, I expect the following result:
a 1, D 2 , b 3, c 4, e 5
I'm thinking to use a Trigger to update the position. Is this the best approach or is there anything else?