Check Balance from another list.

Jun 2, 2011 at 7:56 AM

Hell,

I'm new to SPServices jQuery and I would like to ask if anyone could point me to the right direction regarding problem I have.

I have one custom list. This list will store a number of free seats available for each days.

and I have another list. This list for user to request seat for each dates. Each date , admin will insert available seat to be book. For example, today, the seat available to be book is 100.

For example, user A request 50 seats , user B request 40 seats. So the total request will be 90. And if the request if being approved, only then the number of seats will be deducted from list 1.

So, 100 minus 90 = 10. if user 3 request 20 seat to be book, system will popup error saying that, it already exceed it limits.

I'm trying to get logic here and how it can be done using SPServices?

 

Coordinator
Jun 2, 2011 at 1:00 PM
Amy:

Assuming that the data is available in the lists, then SPServices can help.

You can get the items from any list using GetListItems and process them to make your decisions. There are plenty of examples here in the docs and discussions, but ping back if you have more questions.

M.
>
Jun 9, 2011 at 4:35 AM

Thank M for prompt reply.

I tried use the GetListItems and manage to get the items.

But i don't know how to write code to check the available seat from the list. How we store balance available seat and compare with the new seat request? For the tricky part is..for each date.

So, we need to compare date first and then compare the available seat right?

Coordinator
Jun 9, 2011 at 4:40 AM
You'll need to design and develop this just like any solution you might build with another programming language.

Let me know if you have any questions about SPServices in particular.

M.
>