Tag Info

New answers tagged

1

I found some documentation referencing the above behavior and explains it. When attaching content-types to lists/libraries, the content-types event-handlers are automatically added to the list's event-handler collection. This it to support some basic list/library functionality which has been around since WSS 3.0 already. Even though all the event-handlers ...


1

It's hard to know exactly what your error is but it looks as though your event receiver is doing something to cause the event receiver to re-fire. This could be caused by, for example, adding an item to the list as part of the OnItemAdding event. Or, more insidiously (and this I have actually seen, as opposed to the first example which is pretty easy to ...


0

Most likely, you are not attaching to the correct process. If you are activating the feature via PowerShell, you need to Attach to PowerShell Process.


3

The event receiver will run under the account of the user who has triggered that event, like say ItemAdding will run under the account of the user who has added the item etc. You can use properties.CurrentUserId to get the id of the user under whose context code will be executed. See this blog for more details


0

This issue is solved. For people who have the same problem, the answer is extremely simple. Instead of using currentItem.Update() at the end of the event receiver, just use currentItem.SystemUpdate() and it will update even the document is still open in your Office client.


0

If workflow run under system account token it will not call event receiver, you have to provide user's token for call event receiver, please refer below code would be help to you SPUserToken userToken = null; SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite spsite = new SPSite(url)) { ...


0

I was able to get this working using jquery and a siteColumn. Below is what i did. I created a site column names 'Internal Only' Added this site Column to any list that may contain information i want hidden if the user was off the network. I use jquery to grab the session As i mentioned above i have a session variable and cookie. in my javascript i get ...


0

IMO this is because of item.Update(); which sets the ModifiedByField to "SharePoint program". In server object model we would use SystemUpdate() to avert this. However, I am afraid there is no client object model equivalent of SystemUpdate()


0

Answer to your question yes it will fire ItemCheckedIn event, if inside Versioning settings link->The Require Check Out radio is selected. Some more information: ItemCheckedIn fires 1. once we add document, automatic checking will happen, which will fire ItemCheckedIn. 2. Next when we explicitly call ItemCheckedIn. following sequence you may notice in ...


1

The Event Receivers can only be Scope at Site or Web. http://msdn.microsoft.com/en-us/library/office/ms431081(v=office.14).aspx I believe you would need to use a Feature Stapler. For existing sites, you will need to activate the feature manually, either using the UI, or powershell loop that activates the feature everywhere. Then you need a feature ...


1

Deploy the event receiver and do not activate the Feature.The elements file only attaches the event receiver to list when feature is activated. Attach the event receiver to list from your powershell afterwards.


0

The issue is that these are in two different event receivers. EventFiringEnabled is a thread specific property. The reason it's done this way is that this could cause code from 3rd parties or other developers to function unexpectedly. If you put those into a single event receiver, I would expect that it would work the way you want it to. I'm looking for an ...


0

As of this time there is no EventReceivers property on the ContentType object in the Microsoft.SharePoint.Client.ClientObject namespace. I would love to hear from the SharePoint product team why that property is omitted. grr. I am having to first add a ListAdded Event Receiver of which detects if my content type is present. If it is a ItemAdded event ...


0

In your case you don't need a feature. All you need is a class library with your event receiver class, sign the assembly and deploy it to GAC. Then with PowerShell register the event receiver for the list you want.


2

There is another option how to add Event Receiver to a specific List - add the Event Receiver to the Content Type. Steps: Create custom Content Type for a List Add the Event Receiver to the Content Type Add Content Type to a specific List in order to register the Event Receiver In that case you will be able to control on which List an Event Receiver ...


0

How about attaching it to a dummy list which does not actually exist in the web and then later attaching it to the actual list using Powershell.


0

This is a known limitation of the datasheet because it uses the lists.asmx web service on the backend. There really is no way to do what you want to do cleanly. Here re your options as far as I can see: Create a custom UI using something like Kendo UI's gridview and ListData.svc so that you can add your own validation in between SharePoint and the user. ...


0

Actually, I take back my previous answer. I misremembered something... Just change the value of the field without calling the Update method on the item itself. Since the change is being made before the item is actually saved, this should work without causing the error you mention.


0

Why not write your code in ITEM UPDATED receiver? If no, then add some kind of DELAY in your code (thread.sleep....). Remember this is not idle & is not recommended. Are you disabling event firing in your itemUpdating receiver before calling listItem.Update(). You should disable then update then enable the receivers. I believe, while you are updating ...



Top 50 recent answers are included