Setting a unique priority on a custom list

The custpm list has several field but Group and Priority are the main fields in question.  THere could be hundreds of records spread aout across several groups, but each group can only prioritize ten records the others are non priority.  And there can be no duplicate priority rankings in a group.

can this be done easily?


Group          Priority
AAA                 1
AAA                 2
AAA                 3
AAA                 4
AAA                 5
AAA                 6
AAA                 7
AAA                 8
AAA                 9
AAA                 10
BBB                  1
BBB                  2
BBB                  3
BBB                  4
BBB                  5
BBB                  6
BBB                  7
BBB                  8
BBB                  9
BBB                  10
BBB                  
BBB                  
CCC                  1
CCC                  2
CCC                  3
CCC                  4
CCC                  5
CCC                  6
CCC                  7
CCC                  8
CCC                  9
CCC                  10
CCC                  

Matt PinkstonAsked:
Who is Participating?
 
abhitrigCommented:
I believe its possible but will be a bit complex. So in javascript you will have to check if the group selected already has a priority defined to the limits (10 in this case). If yes, then disable the Save button and display an error.

SPServices (see on codeplex) should help in calling the webservices to talk to the lists.
0
 
abhitrigCommented:
i could think of two options:
1. Manual and limited in functionality: Create a view grouped by group and priority. Manually check to see that group count is always 10. Anything over 10 is incorrect. Keep checking it manually and periodically every day,hr, etc.

2. Dynamic but involves some coding. Create an event handler for the adding/changing events. In the event handler, check to see the group and the priority are already defined to the limits (10 in this case). If yes, display an error and set the event cancel to true.
0
 
Matt PinkstonAuthor Commented:
nothing with like a javascript?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.