0
votes

I have custom list in sharepoint and I am doing validation through sharepoint designer using Jquery. My requirement is I want to access list items from sharepoint in the client side before I can enter new data.

Is there anyway I can access custom list items before I can push new list items in to the custom list.

If I can access then I will make sure no duplicates are being entered into the list.

Could anyone help this.. Or could any one suggest any other approach to fulfill my requirement.

Hari

1

1 Answers

1
votes

There is a jQuery plugin for accessing SharePoint list data. You could use this to retrieve items and compare them. This will not be very fast as the number of list items grows.

Alternatively you can write an Event Handler and attach it to the list. With this, you can attach to a list's OnAdding call. You can examine the list for duplicates and set the cancel flag on the operation if the item would cause a duplicate. This would take longer to build and customize your list but might be the better approach.

Lists expose OnAdding OnAdded OnUpdating OnUpdated OnDeleting OnDeleted. When they are fired is obvious. The 'ing' functions are fired as the operation is in progress and you can stop the event from succeeding. The 'ed' functions are fired after the completion of the activity.