Link to home
Start Free TrialLog in
Avatar of Provost
Provost

asked on

how limit the items in a custom list

Hi,

I want to use a custom list as as a form for reservation. I wan't to limit the number of items in this list. Is it possible?

Thanks.
Avatar of jessc7
jessc7
Flag of United States of America image

What do you want the end-user experience to be?
Avatar of typerracer
typerracer

You could write a custom event receiver in .NET that checks the number of items in a list whenever a new item request is made and check the number of items in the list against your preset allowed number of items.
Avatar of Provost

ASKER

Thanks for your time,

But I don't have access to development server.  I only have access to SharePoint Designer as site collection admin.  
You could have a workflow that queries the list to see how many items there are, and delete any once the limit is reached.

Not a good user experience though.
This is a wonky workaround, but like you, I only have access to SPD so I have to be creative.

I would create a list column that increments with each registration. Then I would create a custom NewForm.aspx (make a copy of the default NewForm.aspx, do not edit it!) and add a text area that tells the user that the class is full.  I would use conditional formatting to hide that text area until the max number of registrants is reached, and set all the other columns in the newForm to display only when the number of registrants is less than the limit.  Then I'd set the custom NewForm as the Supporting File for that list. I've used this trick many times and it's been a lifesaver.
Avatar of Provost

ASKER

Hello,

I want to my users to make reservation for an activity thru a form like
Name:
Email:
Etc...
This form will be the NewForm.aspx when you create a new item of in a list. I want to have a maximum 20 persons by activity.
I don't have access to development server.  I only have access to SharePoint Designer as site collection admin.  
You should be able to do all of the above in SharePoint Designer. If you're not sure how to create a custom NewForm, try this:
http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157%2D7d96%2D4e15%2Da987%2D54b8a3e4d948&ID=73

Good luck!
I should mention that in the above post, you only need to do Steps 1 and 2, then set the conditional formatting on the Custom List Form fields you insert.   When you're done, set the custom NewForm as the supporting file for the list (in SharePoint Designer).
Avatar of Provost

ASKER

Thanks Teeda,

I read, then blog you mention above, very interesting. I've never done that, so there will be some learning. But I understand most of it. The only thing I wonder about is how to increment my counter. From then article I understand I can retrieve its value. But where do you put the logic to add + 1?  With some JavaScript?

Tanks
ASKER CERTIFIED SOLUTION
Avatar of TEEDA
TEEDA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Provost

ASKER

Thanks, I will try with a workflow.