This project has moved and is read-only. For the latest updates, please go here.

Custom ECB helped by SPServices

May 7, 2010 at 10:37 PM

I had a requirement to implement item level security on a list and I also had to add a lot of functions or actions to the items as well. I decided to create a custom Edit Control Block that uses a .aspx page to create a list of commands for the item based on the users permissions on that item. One of the functions I have added is a repeat function that allows the user to basically copy the item to a new item while assigning it to a different department, division, subdivision. The menu cascades out from one item with a list of all departments and then continues out for the divisions and subdivisions. I needed to find a way to check the selected option to be sure that the item had not already been assigned to the selected option. I used SPServices again to accomplish that check which works really well. Now I just need an easy way to copy the item and update a few fields and that whole function will be done!

May 8, 2010 at 5:53 AM
Edited May 8, 2010 at 5:54 AM


Cool stuff, as always.

Copying the item is actually pretty straightforward. Just do a GetListItem to grab the existing item, parse out the values you want, and then use UpdatelistItems to write the new item.


May 8, 2010 at 10:36 AM

Funny that was what I was thinking about doing. By the way, do you know if an item event receiver still fires if items are added using webservices? I have to still do this with item level security so I am using event receivers for that. 

Looking forward to Sharepoint Saturday DC!

May 8, 2010 at 1:51 PM

AFAIK, all the normal events are going to be triggered.  You're creating a real item, and the method you're using to do it doesn't make a whit of difference.

You can set permissions with the Web Services, too, if you don't want to mess with event receivers.


May 9, 2010 at 1:52 AM

The repeated item will most likely need the same permissions as the one it was repeated from. It would be nice to just copy the item to a new item with only the one field changed and carry the permissions with it. Thanks for the info! I will look at how to do it with webservices!