• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1829
  • Last Modified:

Limit the number of records in a list


I'm using SP2007 List.

I'm wondering if it is possible to limit the number of records added in a list.

1) I like to limit to 50 records and no new records added - is this possible?

2) If above is not possible, how do I develop my workflow using SP designer to check if there is 50 records, and the 51th record can still be added but the status will show 'waiting'
1 Solution
nishant joshiTechnology Development ConsultantCommented:
you can use sql query in sp such as

select top(50) columnname from table
SELECT 'Waiting' as columnname from table

Open in new window

Jamie McAllister MVPArchitectCommented:
You can create a number column in your list.

Set it to require a value, require unique values, and validate that it must have a number between one and fifty.

Then you need to make the number auto-increment for each new row. At this stage alas you have to either use Infopath or SharePoint Designer Workflow;



johncheng78Author Commented:
JamieMcAllister - your solution interest me.

Can you advise me how does it restrict the number of records?
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Jamie McAllister MVPArchitectCommented:
The column configuration I mention will insist on up to 50 unique values in a given column between the values of 1 and 50. Validation will stop any non-unique columns that do not meet these rules. Therefore by definition it limits the list to 50 rows of data.

The links for auto-incrementing a value mean that the user doesn't have to come up with the unique number themselves.
johncheng78Author Commented:
Which script is that?
Jamie McAllister MVPArchitectCommented:
I dont see any mention of scripts in my comments. The articles are worth reading.
Amandeep Singh BhullarCommented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Jamie McAllister MVPArchitectCommented:
I believe comments ID: 38303750 and ID: 38315140 provide enough information for a solution to the question.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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