Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes
Accepted

ItemAdded event in Event Receiver

If your event receiver's feature scope is set to "Site", then the "ListUrl" and the "ListTemplateId" will be ignored, and your event receiver will fire on all lists. Now in your case, Whenever task ...
SP Developer's user avatar
  • 3,085
4 votes

How to stop Update event from firing when adding a document to a library

You can't actually stop the Updated event from firing. There's a full lifecycle of events that will always run, so the trick is to check for certain conditions within a given event to determine ...
Matt Jimison's user avatar
4 votes

Remove All RoleAssignemnts Except Current Loggedin User

You could try to add the following before your if (if (t.Name == "SPGroup" || t.Name == "SPUser")) statement: if (roleAssignmentSingle.Member.LoginName == properties.UserLoginName) ...
Damjan Tomic's user avatar
  • 3,656
3 votes

Remove All RoleAssignemnts Except Current Loggedin User

Try the following: if (roleAssignmentSingle.Member.ID != SPContext.Current.Web.CurrentUser.ID) { SPRoleAssColn.Remove(i); }
Arsalan Adam Khatri's user avatar
2 votes

Apply item level permissions for multiple document libraries

I recommend you have a single solution for the event receiver that simply references the library name or URL to decide it's logic for assigning permissions.
Cornelius J. van Dyk's user avatar
2 votes
Accepted

Hide Doc.Lib column from entering values while uploading a document

Try below powershell: $web = Get-SPWeb https://sitecollection $list = $web.Lists["ListName"] $column = $list.Fields.GetFieldByInternalName("NPDModifiedBy") #Change the ShowInEditForm and other ...
Gautam Sheth's user avatar
  • 30.9k
2 votes

How to apply permissions for the curentlistitem using SP D 2013 workflow in SP 2013 On-Prem

Yes it is possible. If current user don't have permission to remove and add permission then you will need to enable "App Step" for workflow.It is same as "RunWithElevatedPriviledge" in SharePoint ...
Samir Khimani's user avatar
2 votes

Differences between SPItemEventProperties.SiteId & SPItemEventProperties.Web.Site.ID

Conceptually, they are the same. First, lets consider the SPSite initialization. properties.siteID and properties.Web.Site.ID will just result in the same site collection ID, so either case ...
SPArcheon's user avatar
  • 6,866
2 votes

Differences between SPItemEventProperties.SiteId & SPItemEventProperties.Web.Site.ID

You can simply use SPItemEventProperties.Web in this context (remember do not dispose it). SPWeb web = properties.Web;
Gennady G's user avatar
  • 1,623
2 votes

"Add New Item" Link on Page

If you are working in SharePoint 2010 than Unfortunately you can't move the "Add New Item" link to the top of the OOBT list view web part. An alternative approach is to add a Content Editor Web Part (...
Hardik's user avatar
  • 7,733
2 votes

Trigger a workflow when an item is added and apply Permissions using ItemEvent receiver simultaneously

please insert a wait condition for 2-3 minutes at the beginning of the designer workflow and check once, so that the code in the event receiver will complete the execution and workflow action ...
TARUN's user avatar
  • 2,856
2 votes
Accepted

Add new itemeventreceiver methods in visual studio on top of existing event receiver

Unfortunately, this dialog is only opened during creating a new event receiver Meanwhile, you can achieve your goal ( I need to add a new itemdeleted/itemdeleting and ItemAttachmentAdded(...
Mohamed El-Qassas MVP's user avatar
1 vote
Accepted

How to update list item column value in ItemAdded event receiver and get the updated value in the same event?

Have GenerateRequestNo return the value that it generates and use that.
Derek Gusoff's user avatar
  • 8,011
1 vote
Accepted

Sharepoint Event Receiver Not Firing on ItemAdded

1- Check the Element.xml of the Event Receiver and add the listUrl Attribute : <Receivers ListUrl="Lists/YourListUrl"> // For simple Lists or <Receivers ListUrl="Documents"> //For ...
Ahmed Bouchaala's user avatar
1 vote

Online Sharepoint - REST issue - Microsoft.SharePoint.SPException - Error 2130575251

The following code for your reference: using Microsoft.SharePoint.Client; using Newtonsoft.Json; using System; using System.Net.Http; using System.Net.Http.Headers; using System.Security; using ...
LZ_MSFT's user avatar
  • 6,219
1 vote

How to stop Update event from firing when adding a document to a library

On Item added, before item.update() disable event firing, this.EventFiringEnabled =true; will do
Praveen Pudi's user avatar
1 vote
Accepted

No item exists at http://xxxx/Common/Forms/EditForm.aspx It may have been deleted or renamed by another user

Try to debug your event receiver and you will note that this error raised from the itemAdded event, because the metadata is not available in the ItemAddedevent and this cause No item exists. It ...
Mohamed El-Qassas MVP's user avatar
1 vote

Automatically create HTML pages on adding an item in SP 2013 list

Don't think in creating pages; Think in one (webpart)page that has dynamic content (metadata in your employee list) Instead of solving it with code if you have a hammer everything starts to look ...
Danny '365CSI' Engelman's user avatar
1 vote

Apply item level permissions for multiple document libraries

No need to create a specific solution for every document library, Just create one SharePoint solution with an event receiver for a Document Library as shown below: Note: In Elements.xml don't ...
Mohamed El-Qassas MVP's user avatar
1 vote

Item event handler for both SPLists and SPDocumentLibraries in one single VS 2013 solution in my SP 2013 ON-PREMISES

You can defintely have different event reveivers in the same solution/WSP package. A WSP is a container that groups one or more features + independant artefacts lile DLL(s) _layouts pages, images or ....
Evariste's user avatar
  • 9,731
1 vote

Item event handler for both SPLists and SPDocumentLibraries in one single VS 2013 solution in my SP 2013 ON-PREMISES

Yes, it's possible. You need to add new Event Receiver using VS dialog 8 times, that will create 8 new event receivers for you, all in one solution and wsp. You can even later merge them in ...
Sergei Sergeev's user avatar

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