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

Limit the number of records in a list

Hi,

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'
0
johncheng78
Asked:
johncheng78
1 Solution
 
nishant joshiTechnology Development ConsultantCommented:
you can use sql query in sp such as

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

Open in new window


Thanks,
Nishant
0
 
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;

http://dlairman.wordpress.com/2011/01/10/add-a-unique-auto-incrementing-column-to-a-sharepoint-list/

https://www.nothingbutsharepoint.com/sites/eusp/Pages/sharepoint-how-to-create-an-auto-incrementing-number-field-for-use-in-a-custom-id-part-1.aspx

http://sharepointclaimsguru.blogspot.ch/2011/07/auto-increment-columns-in-sharepoint.html
0
 
johncheng78Author Commented:
JamieMcAllister - your solution interest me.

Can you advise me how does it restrict the number of records?
0
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.
0
 
johncheng78Author Commented:
Which script is that?
0
 
Jamie McAllister MVPArchitectCommented:
I dont see any mention of scripts in my comments. The articles are worth reading.
0
 
Amandeep Singh BhullarCommented:
I've requested that this question be deleted for the following reason:

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

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