Tag Info

Hot answers tagged

1

You need to add a column to the first calendar that stores a unique key of any related item in the team calendar. You could use the SharePoint ID of the first calendar, for example. Add a column to the Team calendar called "ParentID". Let the workflow find an item with that ParentID = current Item ID in the Team calendar. If that item is found, the workflow ...


1

Doing anything even moderately intensive in sandbox code (like creating a subsite) is asking for trouble, sooner or later. You may find that creating a fake list item and broken site will become a "deployment step" in this scenario. If your environment is on 2013, I'd like to suggest an alternate approach: Create an auto-hosted App with a web service that ...


1

Creating a site is a long running operation and therefore its a bad practice to do it an ItemAdding event which is synchronous by default. Make it on the ItemAdded Event and then it will be created, but no visual feedback will be given to the user. Normally for this, we create a custom action on the list item, that custom actions open a simple aspx page ...


1

Just a small, but very important addition not related directly to your question (as it was already answered by Thantos). There is an error in your code. You should never dispose SPWeb object obtained from SPContext.Current.Web (you don't need the using operator). Here is an article about it: Disposing Objects


1

public override void ListAdded(SPListEventProperties properties) { SPUtility.ValidateFormDigest(); SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(url)) { using (SPWeb web = site.OpenWeb()) { ...



Only top voted, non community-wiki answers of a minimum length are eligible