Tag Info

New answers tagged

1

You can put a check like this : SPFile file=item.File; if(file.Level==SPFileLevel.Published) { if (file.CheckOutType == SPFile.SPCheckOutType.None) { file.CheckOut(); // Checking out the file } }


1

Yes you can check what is the status of the document in the library. Check this code: SPListItem listItem = GetListItem(); var moderationInformation = listItem.ModerationInformation; if (moderationInformation != null) { if (moderationInformation.Status == SPModerationStatusType.Approved) { //approved } else if ...


0

I stumbled across this issue as well. Though your solution works, there is an easier way of solving it. In ItemUpdating the value of a Managed Metadata field in the AfterProperties is a string. So instead of doing what you have done, you can just create a new instance of the TaxonomyFieldValue. TaxonomyFieldValue newValue = new ...


0

This type of functionality doesn't exist in SharePoint (yet!). However you can create it yourself by a combination of social feature development combined with remote event receivers. Get started developing with social features in SharePoint 2013 How to: Create a remote event receiver Adventures with SharePoint 2013 Remote Event Receivers – Part 1 of 3


2

I think that you should not to use properties.Dispose() method, furthermore you should not to use properties.Web.Dispose(). I'm sure these objects are used in SharePoint later. As workaround you can try to use this snippet: using (SPWeb web = properties.OpenWeb()) { //code }


0

Generally scope should be Web because Event Receivers are triggered by certain events on either a SPWeb, SPList or SPListItem. We can categorize SharePoint events in two different categories: by the “level” which fires the event (site, list, item), and by the type of the event (synchronous and asynchronous). Again depends what you want to achieve... scope ...


0

Event Receiver Feature must be set as Web Scope.. http://msdn.microsoft.com/en-us/library/ms454835.aspx


0

I would first check if your Event Receiver is attached to the list. It's easy to view all attached Event Receivers with PowerShell: $web = Get-SPWeb <Url> $list = $web.Lists["<ListName>"] $list.EventReceivers


0

You can change in "Receivers" tag in "Elements.xml " as "Receivers ListTemplateId="someNumber" to "Receivers ListUrl="Lists/yourListName".


0

By default it should apply to all the document libraries in the web if the feature scope is Web, and to all the document libraries in the site if the feature scope is Site. From your question I assume you have specified ListTemplateId="101" in your definition file. Another possible case: if the event receiver throws an exception you will not get any ...


1

Alexander is right, OOTB SharePoint will read/write properties to/from your docs. You can even have these properties visible and accessible in your content of the doc. You need to first add the doc to the library, so the doc inherits the properties. Open the doc in Word, go to the Insert ribbon, then Quick Part, then Document Property. This will list all ...


0

For SharePoint foundation the OOTB way is called Document Property Promotion.


0

In that case, event receiver still attached to the list and cause alot of problem to your site.Only thing you can do is simply delete it. run this script to get the event receiver attach to a list. $spWeb = Get-SPWeb -Identity http://web.spdev.local $spList = $spWeb.Lists["My List Name"] $spList.EventReceivers | Select Name,Assembly,Type Now you want to ...


2

as far as I know retracting solutions doesn't deactivate their features, so although you wont be able to find or activate/deactivate those features, their references are still there. on the particular case of event receivers, it could turn out to be a major problem. the receiver may still be attached and if you redeploy/reactivate you may end up with firing ...


1

If you want your own Error message, you have to make an application page (e.g. "error.aspx") and design it as per your requirement. Then set some properties like: properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl; properties.RedirectUrl = "Error.aspx page's url"; Then this page will be displayed instead of the server error page.


1

I hope by now you should have got your answer. In case not, below is the solution of the same. I am posting this now as I just now ran into the same problem, but fortunately, I could come out of it pretty quickly,and I think it would be helpful to all other developers like us. Follow the below steps: Go to Solution Explorer on Visual Studio Open the ...


1

Maybe a stupid question but have you set the Deployment Target for the assembly to be GlobalAssemblyCache in the Package configuration?


0

Assuming you are talking about a SP2010 or SP2013 on-premise version. 3 options: create an event handler that captures the onAdded event on the document library. In the event handler check the file extension and convert the file if necessary create a custom workflow. Same principle as above but put the converting logic in a workflow. A workflow is easier ...


1

Microsoft is going to deprecate Sandbox solutions, so you shouldn't consider it for new development. Visual Studio Options - Remote/app event receiver is one option, explorer more on this here. However, you also have the option of Visual Studio SharePoint Workflow App No code solution - If you are not comfortable with Visual Studio programming then you ...


0

You can use Sandbox solution to add event receivers to your custom list. The other option would be using Remote event receivers if you are using any app model. How does Sharepoint Online Event Receivers work? ...


2

You might need to do the following: In the library settings click "Versioning settings" Set "Requite Check Out" to true Done Update: I've just realized that you need to check out the document when you are adding it, not editing... Then this might work for you: SPListItem.File.CheckOut


0

Well, I was able to solve the issue like below: if (spiCurrentItem != null) { spiCurrentItem ["Title"] = spModifiedItem.Title; if (spModifiedItem.ModerationInformation.Status == SPModerationStatusType.Approved) { spiCurrentItem.ModerationInformation.Status = SPModerationStatusType.Approved; } spiCurrentItem.Update(); } The ...



Top 50 recent answers are included