Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

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                  

0
Matt Pinkston
Asked:
Matt Pinkston
  • 2
1 Solution
 
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
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now