Setting a unique priority on a custom list

Posted on 2011-10-27
Last Modified: 2012-05-12
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
CCC                  1
CCC                  2
CCC                  3
CCC                  4
CCC                  5
CCC                  6
CCC                  7
CCC                  8
CCC                  9
CCC                  10

Question by:Matt Pinkston
    LVL 14

    Expert Comment

    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.

    Author Comment

    by:Matt Pinkston
    nothing with like a javascript?
    LVL 14

    Accepted Solution

    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.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
    When installing SharePoint 2010 RTM I came across a strange error, I was getting timeouts during the installation. I searched the web and found the best solution to be found here (…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now