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
sai dhanasai dhana 

To give Priority for the record

Hi i have a very urgent requirement. need to write trigger on cusom obj Delta_sceme__C:

on that obj we have two custom picklist fields(Priority1, Priority 2) with integer values start from 1 to 25.
now the requiremet is to give the priority for each and every record on that object. plz look below one.

User-added image
suppose the priority of the records like

        Old     new
         1       1
         2         9
         3       2
         4         3        
         5         4    
         6       5
         7       6
         8       7
         9       8
         10     10 
    Here i want to chage(Old) 2nd priority to 9(check in new) then the new priority should decrease from 9th rec should decrease the 8, from 8 to 7 .... and vice versa. 


Like when we update priority of one record remaining records priority need to be updated. and priority should be unique.


plz share any code samples and ur suggestions ASAP




Thanks in Advance