function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
amrita h 7amrita h 7 

How to rank Users depends on a custom field in apex?


Question in detail : I have 20 Users {U1, U2, U3....}
and 5 Regions {R1, R2, R3, R4, R5}
and Ammount__C custom field on User.
Now those users are distributed among those regions. So i want to give them Rank(Rank__c) depends on the amount they have. for Greater the amount rank will be first. And it should be region wise. Should not consider all users at once. If One region has 6 users, then they should be ranked from 1 to 6. same thing for the next region again. Hope i am clear here.

How to achieve this?