SharePoint 2013 event receiver error

I am currently working on a SharePoint online project. I am facing a strange issue. My code generates 6 documents
in 6 different document libraries along with other metadata. When I save data to a List, the event receiver fires and creates all the 6 documents. But sometimes it stops creating the 6 documents and left with 1 or 2 documents. Sometimes documents has been
created but without any metadata. The same code is working fine in my on-premises environment, but it sometimes breaks in the Office 365 environment. I also created a log list to track the issue as we cannot debug in Office 365. In the log list I found a error
message saying "Thread was being aborted." Below is my code. please help it is happening only in Office 365 environment.
using Microsoft.SharePoint;
/// <summary>
/// List Item Events
/// </summary>
public class ExcelGenReceiver : SPItemEventReceiver
/// <summary>
/// The template URL
/// </summary>
private const string TemplateUrl = "/Quotation Analysis Electrical/Forms/Quotation Analysis Sheet ELEC_Blank.xlsm";
/// <summary>
/// The template url1
/// </summary>
private const string TemplateUrl1 = "/Quotation Analysis Mechanical/Forms/Quotation Analysis Sheet MECH_Blank.xlsm";
/// <summary>
/// The template url2
/// </summary>
private const string TemplateUrl2 = "/TenderSummaryLib/Forms/TenderSummaryBlankMaster1.xlsm";
/// <summary>
/// The RFI template URL
/// </summary>
private const string RfiTemplateUrl = "/EstimatingRFI/Forms/RFI Schedule MASTER.docx";
/// <summary>
/// The drawing template URL
/// </summary>
private const string DrawingTemplateUrl = "/Tender and Drawing Schedule/Forms/Tender Document Drawing Schedule.docx";
/// <summary>
/// The tender return template URL
/// </summary>
private const string TenderReturnTemplateUrl = "/Est_Tender_Pricing_Document/Forms/Tender Pricing Document blank.xlsm";
/// <summary>
/// The project number
/// </summary>
private string projectNumber = string.Empty;
/// <summary>
/// The project name
/// </summary>
private string projectName = string.Empty;
/// <summary>
/// The no bid
/// </summary>
private string noBid;
/// <summary>
/// The team
/// </summary>
private string team;
/// <summary>
/// The description
/// </summary>
private string description;
/// <summary>
/// The status
/// </summary>
private string status;
/// <summary>
/// The electrical
/// </summary>
private SPUser electrical;
/// <summary>
/// The mechanical
/// </summary>
private SPUser mechanical;
/// <summary>
/// The document date
/// </summary>
private DateTime? docDate;
/// <summary>
/// The tender received
/// </summary>
private DateTime? tenderReceived;
/// <summary>
/// The tender return
/// </summary>
private DateTime? tenderReturn;
/// <summary>
/// The pre construction program start date
/// </summary>
private DateTime? preConstructionProgramStart;
/// <summary>
/// The pre construction program end date
/// </summary>
private DateTime? preConstructionProgramEnd;
/// <summary>
/// The sector
/// </summary>
private string sector;
/// <summary>
/// The design build
/// </summary>
private string designBuild;
/// <summary>
/// The build type
/// </summary>
private string buildType;
/// <summary>
/// The service program start date
/// </summary>
private DateTime? serviceProgramStart;
/// <summary>
/// The service program completion date
/// </summary>
private DateTime? serviceProgramCompletion;
/// <summary>
/// The client1
/// </summary>
private string client1;
/// <summary>
/// The client2
/// </summary>
private string client2;
/// <summary>
/// The client3
/// </summary>
private string client3;
/// <summary>
/// The client4
/// </summary>
private string client4;
/// <summary>
/// The consultant
/// </summary>
private string consultant;
/// <summary>
/// An item is being added.
/// </summary>
/// <param name="properties">The Item Event properties</param>
public override void ItemAdded(SPItemEventProperties properties)
//this.EventFiringEnabled = false;
var web = properties.Web;
var listItem = properties.ListItem;
try
LogIssue(web, null, "Item Added", "List Item Id {0}", listItem.ID);
if (!this.AttemptCopyProcess(listItem))
LogIssue(web, null, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
catch (Exception ex)
LogIssue(web, ex, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
finally
//this.EventFiringEnabled = true;
LogIssue(web, null, "List Id : " + listItem.ID, "Event Receiver completed sucessfully.");
/// <summary>
/// Logs any issues found
/// </summary>
/// <param name="webContext">The web context.</param>
/// <param name="exception">The exception, if null not exception details are written</param>
/// <param name="contextId">The context identifier, a unique identifier that allows us to know where the call originated, i.e. a List and ListItem Id, or a Page Url</param>
/// <param name="comment">The comment.</param>
/// <param name="args">The arguments.</param>
private static void LogIssue(SPWeb webContext, Exception exception, string contextId, string comment, params object[] args)
//// if (webContext.AllProperties.ContainsKey("EnableLogging"))
var list = webContext.Lists.TryGetList("ErrorIssues");
if (list != null)
var item = list.AddItem();
item["Title"] = contextId;
if (exception != null)
item["Message"] = exception.Message;
item["InnerException"] = exception.InnerException ?? (object)string.Empty;
item["StackTrace"] = exception.StackTrace;
if (!string.IsNullOrEmpty(comment))
item["Comment"] = string.Format(comment, args);
item.Update();
/// <summary>
/// Assigns the field.
/// </summary>
/// <param name="listItem">The list item.</param>
/// <param name="fieldName">Name of the field.</param>
/// <param name="contextId">The context identifier.</param>
/// <returns>The fields string value if present, otherwise string.empty.</returns>
private static string AssignField(SPListItem listItem, string fieldName, string contextId)
var fieldValue = string.Empty;
if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
fieldValue = listItem[fieldName].ToString();
else
LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
return fieldValue;
/// <summary>
/// Assigns the field as a DateTime
/// </summary>
/// <param name="listItem">The list item.</param>
/// <param name="fieldName">Name of the field.</param>
/// <param name="contextId">The context identifier.</param>
/// <returns>Returns the date if found, otherwise returns DateTime.MinValue</returns>
private static DateTime? AssignDateField(SPListItem listItem, string fieldName, string contextId)
DateTime? fieldValue = null;
if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
fieldValue = Convert.ToDateTime(listItem[fieldName].ToString());
else
LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
return fieldValue;
/// <summary>
/// Creates the folder.
/// </summary>
/// <param name="listdoc">The list.</param>
/// <param name="folderName">Name of the folder.</param>
private static void CreateFolder(SPList listdoc, string folderName)
LogIssue(listdoc.ParentWeb, null, "List Id : " + listdoc.ID, "Creating folder {0} in {1}", folderName, listdoc.RootFolder.ServerRelativeUrl);
// Updated by Indusnet
SPListItem folder1 = listdoc.Items.Add(listdoc.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder);
folder1["Name"] = folderName;
folder1.Update();
listdoc.Update();
// End Updated
/// <summary>
/// Assigns the user field.
/// </summary>
/// <param name="listItem">The list item.</param>
/// <param name="fieldName">Name of the field.</param>
/// <param name="contextId">The context identifier.</param>
/// <returns>Returns the user if found, otherwise null.</returns>
private static SPUser AssignUserField(SPListItem listItem, string fieldName, string contextId)
SPUser user = null;
if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
var userField = (SPFieldUser)listItem.Fields.GetField(fieldName);
var fieldValue = (SPFieldUserValue)userField.GetFieldValue(listItem["electrical_proj_manager"].ToString());
user = fieldValue.User;
else
LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
return user;
/// <summary>
/// Attempts the copy process.
/// </summary>
/// <param name="listItem">The list item.</param>
/// <returns>True if it successfully processed, false otherwise.</returns>
private bool AttemptCopyProcess(SPListItem listItem)
if (listItem.ParentList.Title != "Enquiry_Template")
LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "ListItem titles is not Enquiry_Template, aborting.");
return false;
var finalNum = "15-" + new Random().Next(0, 9999).ToString("D4");
this.Initialize(listItem, finalNum);
if (this.noBid != "Yes")
LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "The noBid field does not equal Yes, aborting.");
return false;
this.CopyFiles(listItem.Web, finalNum);
this.CreateFolders(listItem.Web);
return true;
/// <summary>
/// Copies the files.
/// </summary>
/// <param name="web">The web.</param>
/// <param name="finalNum">The final number.</param>
private void CopyFiles(SPWeb web, string finalNum)
LogIssue(web, null, "Web Id : " + web.ID, "Setting the copying of files ...");
var mechanicalQuoteList = web.Lists["Quotation Analysis Mechanical"];
var electricalQuoteList = web.Lists["Quotation Analysis Electrical"];
var tenderSummarList = web.Lists["TenderSummaryLib"];
var estimatingList = web.Lists["EstimatingRFI"];
var tenderSheduleList = web.Lists["Tender and Drawing Schedule"];
var tenderPricingList = web.Lists["Est_Tender_Pricing_Document"];
var url1 = mechanicalQuoteList.RootFolder.ServerRelativeUrl;
var url = electricalQuoteList.RootFolder.ServerRelativeUrl;
var url2 = tenderSummarList.RootFolder.ServerRelativeUrl;
var urlA = estimatingList.RootFolder.ServerRelativeUrl;
var urlB = tenderSheduleList.RootFolder.ServerRelativeUrl;
var urlC = tenderPricingList.RootFolder.ServerRelativeUrl;
var foldername1 = string.Empty;
var foldername = string.Empty;
var foldername2 = string.Empty;
var foldernameA = string.Empty;
var foldernameB = string.Empty;
var foldernameC = string.Empty;
var folder1 = web.Folders[url1 + "/" + foldername1];
var folder = web.Folders[url + "/" + foldername];
var folder2 = web.Folders[url2 + "/" + foldername2];
var folderA = web.Folders[urlA + "/" + foldernameA];
var folderB = web.Folders[urlB + "/" + foldernameB];
var folderC = web.Folders[urlC + "/" + foldernameC];
if (!folder1.Exists && !folder.Exists && !folder2.Exists && !folderA.Exists && !folderB.Exists && !folderC.Exists)
var folders1 = web.GetFolder(url1).SubFolders;
var folders = web.GetFolder(url).SubFolders;
var folders2 = web.GetFolder(url2).SubFolders;
var foldersA = web.GetFolder(urlA).SubFolders;
var foldersB = web.GetFolder(urlB).SubFolders;
var foldersC = web.GetFolder(urlC).SubFolders;
folders1.Add(foldername1);
folders.Add(foldername);
folders2.Add(foldername2);
foldersA.Add(foldernameA);
foldersB.Add(foldernameB);
foldersC.Add(foldernameC);
var file1 = web.GetFile(web.Site.Url + TemplateUrl1);
var file = web.GetFile(web.Site.Url + TemplateUrl);
var file2 = web.GetFile(web.Site.Url + TemplateUrl2);
var fileA = web.GetFile(web.Site.Url + RfiTemplateUrl);
var fileB = web.GetFile(web.Site.Url + DrawingTemplateUrl);
var fileC = web.GetFile(web.Site.Url + TenderReturnTemplateUrl);
if (file1 != null && file != null && file2 != null && fileA != null && fileB != null && fileC != null)
var fileName = string.Format("{0}/{1}{2}", folder1.ServerRelativeUrl, this.projectName, ".xlsm");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 1 {0} to {1}...", file1.Name, fileName);
var byteArray1 = file1.OpenBinary();
var uploadedFile1 = folder1.Files.Add(fileName, byteArray1, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 1 Uploaded with new ID of {0}", uploadedFile1.Item.ID);
this.EventFiringEnabled = false;
var listitem1 = uploadedFile1.Item;
listitem1["Name"] = this.projectName;
listitem1["EnquiryNo"] = finalNum;
listitem1["Project_Name"] = this.projectName;
listitem1["Tender_Received"] = this.tenderReceived;
listitem1["Tender_Return"] = this.tenderReturn;
listitem1["Quotation_Analysis_Mech_Url"] = "https://groupportal.sharepoint.com/sites/EnginSouth/Quotation%20Analysis%20Mechanical/Forms/DispForm.aspx?ID=" + listitem1.ID;
listitem1.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 1.");
fileName = string.Format("{0}/{1}{2}", folder.ServerRelativeUrl, this.projectName, ".xlsm");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 2 {0} to {1}...", file.Name, fileName);
var byteArray = file.OpenBinary();
var uploadedFile = folder.Files.Add(fileName, byteArray, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 2 Uploaded with new ID of {0}", uploadedFile.Item.ID);
this.EventFiringEnabled = false;
var listitem = uploadedFile.Item;
listitem["Name"] = this.projectName;
listitem["EnquiryNo"] = finalNum;
listitem["Project_Name"] = this.projectName;
listitem["Tender_Received"] = this.tenderReceived;
listitem["Tender_Return"] = this.tenderReturn;
listitem["Quotation_Analysis_Elec_Url"] = "https://groupportal.sharepoint.com/sites/EnginSouth/Quotation%20Analysis%20Electrical/Forms/DispForm.aspx?ID=" + listitem.ID;
listitem.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 2.");
fileName = string.Format("{0}/{1}{2}", folderA.ServerRelativeUrl, this.projectName, ".docx");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 3 {0} to {1}...", fileA.Name, fileName);
var byteArrayA = fileA.OpenBinary();
var uploadedFileA = folderA.Files.Add(fileName, byteArrayA, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 3 Uploaded with new ID of {0}", uploadedFileA.Item.ID);
this.EventFiringEnabled = false;
var listitemA = uploadedFileA.Item;
listitemA["Name"] = this.projectName;
listitemA["EnquiryNo"] = finalNum;
listitemA["Project_Name"] = this.projectName;
listitemA["Date"] = this.docDate;
listitemA["Description"] = this.description;
listitemA["ProjectNo"] = this.projectNumber;
listitemA["RFIUrl"] = "https://groupportal.sharepoint.com/sites/EnginSouth/EstimatingRFI/Forms/DispForm.aspx?ID=" + listitemA.ID;
listitemA.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 3.");
fileName = string.Format("{0}/{1}{2}", folderB.ServerRelativeUrl, this.projectName, ".docx");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 4 {0} to {1}...", fileB.Name, fileName);
var byteArrayB = fileB.OpenBinary();
var uploadedFileB = folderB.Files.Add(fileName, byteArrayB, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 4 Uploaded with new ID of {0}", uploadedFileB.Item.ID);
this.EventFiringEnabled = false;
var listitemB = uploadedFileB.Item;
listitemB["Name"] = this.projectName;
listitemB["EnquiryNo"] = finalNum;
listitemB["Project_Name"] = this.projectName;
listitemB["Date"] = this.docDate;
listitemB["Description"] = this.description;
listitemB["ProjectNo"] = this.projectNumber;
listitemB["DrawingURL"] = "https://groupportal.sharepoint.com/sites/EnginSouth/Tender%20and%20Drawing%20Schedule/Forms/DispForm.aspx?ID=" + listitemB.ID;
listitemB.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 4.");
fileName = string.Format("{0}/{1}{2}", folderC.ServerRelativeUrl, this.projectName, ".xlsm");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", fileC.Name, fileName);
var byteArrayC = fileC.OpenBinary();
var uploadedFileC = folderC.Files.Add(fileName, byteArrayC, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 5 Uploaded with new ID of {0}", uploadedFileC.Item.ID);
this.EventFiringEnabled = false;
var listitemC = uploadedFileC.Item;
listitemC["Name"] = this.projectName;
listitemC["EnquiryNo"] = finalNum;
listitemC["Project_Name"] = this.projectName;
listitemC["Date"] = this.docDate;
listitemC["Description"] = this.description;
listitemC["ProjectNo"] = this.projectNumber;
listitemC["PricingURL"] = "https://groupportal.sharepoint.com/sites/EnginSouth/Est_Tender_Pricing_Document/Forms/DispForm.aspx?ID=" + listitemC.ID;
listitemC.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 5.");
fileName = string.Format("{0}/{1}{2}", folder2.ServerRelativeUrl, this.projectName, ".xlsm");
LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", file2.Name, fileName);
var byteArray2 = file2.OpenBinary();
var uploadedFile2 = folder2.Files.Add(fileName, byteArray2, true);
LogIssue(web, null, "Web Id : " + web.ID, "File 6 Uploaded with new ID of {0}", uploadedFile2.Item.ID);
this.EventFiringEnabled = false;
var listitem2 = uploadedFile2.Item;
listitem2["Name"] = this.projectName;
listitem2["EnquiryNo"] = finalNum;
listitem2["Project_Name"] = this.projectName;
listitem2["Date"] = this.docDate;
listitem2["Team"] = this.team;
listitem2["Estimator_Electrical"] = this.electrical;
listitem2["Estimator_Mechanical"] = this.mechanical;
listitem2["Status"] = this.status;
listitem2["Tender_Received"] = this.tenderReceived;
listitem2["Tender_Return"] = this.tenderReturn;
listitem2["Sector"] = this.sector;
listitem2["Design_Build"] = this.designBuild;
listitem2["Build_Type"] = this.buildType;
listitem2["Service_Prog_Start"] = this.serviceProgramStart;
listitem2["Service_Prog_Completion"] = this.serviceProgramCompletion;
listitem2["Client_1"] = this.client1;
listitem2["Client_2"] = this.client2;
listitem2["Client_3"] = this.client3;
listitem2["Client_4"] = this.client4;
listitem2["Consultant"] = this.consultant;
listitem2["Pre-construction_Prog_Start"] = this.preConstructionProgramStart;
listitem2["Pre-construction_Prog_End"] = this.preConstructionProgramEnd;
listitem2["Tender_Summary_Url"] = "https://groupportal.sharepoint.com/sites/EnginSouth/TenderSummaryLib/Forms/DispForm.aspx?ID=" + listitem2.ID;
listitem2.SystemUpdate(false);
this.EventFiringEnabled = true;
LogIssue(web, null, "Web Id : " + web.ID, "Copied file 6.");
/// <summary>
/// Creates the folders.
/// </summary>
/// <param name="web">The web.</param>
private void CreateFolders(SPWeb web)
var projectListId = web.Lists.Add(this.projectName.Replace(' ', '_'), string.Empty, SPListTemplateType.DocumentLibrary);
var projectList = web.Lists[projectListId];
projectList.OnQuickLaunch = true; // The document library will appear in Quick Launch bar.
CreateFolder(projectList, "1.Tender Documents");
CreateFolder(projectList, "2. Electrical");
CreateFolder(projectList, "3. Mechanical");
CreateFolder(projectList, "4. Correspondance");
CreateFolder(projectList, "5. Settlement Meeting Docs");
CreateFolder(projectList, "6. Tender Return Docs");
CreateFolder(projectList, "7. Tender Handover");
projectList.Update();
/// <summary>
/// Initializes the specified list item.
/// </summary>
/// <param name="listItem">The list item.</param>
/// <param name="finalNum">The final number.</param>
private void Initialize(SPListItem listItem, string finalNum)
var contextId = string.Format("List:{0}, Id:{1}", listItem.ParentList.Title, listItem.ID);
this.noBid = AssignField(listItem, "Bid", contextId);
this.projectName = AssignField(listItem, "Project_Name", contextId);
var teamlookup = AssignField(listItem, "Team", contextId);
var lookupParts = teamlookup.Split(new[] { ";#" }, StringSplitOptions.None);
this.team = lookupParts[1];
this.description = AssignField(listItem, "Description", contextId);
this.status = AssignField(listItem, "enquiry_status", contextId);
this.electrical = AssignUserField(listItem, "electrical_proj_manager", contextId);
this.mechanical = AssignUserField(listItem, "mechanical_proj_manager", contextId);
this.docDate = AssignDateField(listItem, "Date", contextId);
this.tenderReceived = AssignDateField(listItem, "Tender_Received", contextId);
this.tenderReturn = AssignDateField(listItem, "Tender_Return", contextId);
this.preConstructionProgramStart = AssignDateField(listItem, "Pre-construction_Prog_Start", contextId);
this.preConstructionProgramEnd = AssignDateField(listItem, "Pre-construction_Prog_End", contextId);
this.sector = AssignField(listItem, "Sector", contextId);
this.designBuild = AssignField(listItem, "Design_Build", contextId);
this.buildType = AssignField(listItem, "Build_Type", contextId);
this.serviceProgramStart = AssignDateField(listItem, "Service_Prog_Start", contextId);
this.serviceProgramCompletion = AssignDateField(listItem, "Service_Prog_Completion", contextId);
this.client1 = AssignField(listItem, "Client_1", contextId);
this.client2 = AssignField(listItem, "Client_2", contextId);
this.client3 = AssignField(listItem, "Client_3", contextId);
this.client4 = AssignField(listItem, "Client_4", contextId);
this.consultant = AssignField(listItem, "Consultant", contextId);
if (this.status == "Won")
this.projectNumber = string.Format("15-{0}-{1}", this.team, new Random().Next(0, 9999).ToString("D4"));
if (this.status == "Active" || this.status == "Closed")
this.projectNumber = "No Project No";
listItem["ProjectNo"] = this.projectNumber;
listItem["EnquiryNo"] = finalNum;
listItem.Web.AllowUnsafeUpdates = true;
listItem.SystemUpdate(false);

Hi,
In this forum we mainly discuss questions and feedbacks about Office client products, as your question is about SharePoint 2013, I suggest you post this thread in SharePoint forum:
https://social.technet.microsoft.com/Forums/office/en-US/home?category=sharepoint
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
Regards,
Melon Chen
TechNet Community Support
It's recommended to download and install
Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]

Similar Messages

  • SharePoint online 2013 event receiver error

    I am currently working on a SharePoint online project. My code generates 6 documents in 6 different document libraries along with other metadata. When I save data to a List, the event receiver fires and creates all the 6 documents. But sometimes it stops creating
    the 6 documents and left with 1 or 2 documents. Sometimes documents has been created but without any metadata.
    The same code is working fine in my on-premises environment, but it sometimes breaks in the Office 365 environment. I also created a log list to track the issue as we cannot debug in Office 365. In the log list I found a error message saying "Thread was
    being aborted." Below is my code. please help it is happening only in Office 365 environment.
    namespace ExcelGen.ExcelGenReceiver
    using System;
    using Microsoft.SharePoint;
    /// <summary>
    /// List Item Events
    /// </summary>
    public class ExcelGenReceiver : SPItemEventReceiver
    /// <summary>
    /// The template URL
    /// </summary>
    private const string TemplateUrl = "/Quotation Analysis Electrical/Forms/Quotation Analysis Sheet ELEC_Blank.xlsm";
    /// <summary>
    /// The template url1
    /// </summary>
    private const string TemplateUrl1 = "/Quotation Analysis Mechanical/Forms/Quotation Analysis Sheet MECH_Blank.xlsm";
    /// <summary>
    /// The template url2
    /// </summary>
    private const string TemplateUrl2 = "/TenderSummaryLib/Forms/TenderSummaryBlankMaster1.xlsm";
    /// <summary>
    /// The RFI template URL
    /// </summary>
    private const string RfiTemplateUrl = "/EstimatingRFI/Forms/RFI Schedule MASTER.docx";
    /// <summary>
    /// The drawing template URL
    /// </summary>
    private const string DrawingTemplateUrl = "/Tender and Drawing Schedule/Forms/Tender Document Drawing Schedule.docx";
    /// <summary>
    /// The tender return template URL
    /// </summary>
    private const string TenderReturnTemplateUrl = "/Est_Tender_Pricing_Document/Forms/Tender Pricing Document blank.xlsm";
    /// <summary>
    /// The project number
    /// </summary>
    private string projectNumber = string.Empty;
    /// <summary>
    /// The project name
    /// </summary>
    private string projectName = string.Empty;
    /// <summary>
    /// The no bid
    /// </summary>
    private string noBid;
    /// <summary>
    /// The team
    /// </summary>
    private string team;
    /// <summary>
    /// The description
    /// </summary>
    private string description;
    /// <summary>
    /// The status
    /// </summary>
    private string status;
    /// <summary>
    /// The electrical
    /// </summary>
    private SPUser electrical;
    /// <summary>
    /// The mechanical
    /// </summary>
    private SPUser mechanical;
    /// <summary>
    /// The document date
    /// </summary>
    private DateTime? docDate;
    /// <summary>
    /// The tender received
    /// </summary>
    private DateTime? tenderReceived;
    /// <summary>
    /// The tender return
    /// </summary>
    private DateTime? tenderReturn;
    /// <summary>
    /// The pre construction program start date
    /// </summary>
    private DateTime? preConstructionProgramStart;
    /// <summary>
    /// The pre construction program end date
    /// </summary>
    private DateTime? preConstructionProgramEnd;
    /// <summary>
    /// The sector
    /// </summary>
    private string sector;
    /// <summary>
    /// The design build
    /// </summary>
    private string designBuild;
    /// <summary>
    /// The build type
    /// </summary>
    private string buildType;
    /// <summary>
    /// The service program start date
    /// </summary>
    private DateTime? serviceProgramStart;
    /// <summary>
    /// The service program completion date
    /// </summary>
    private DateTime? serviceProgramCompletion;
    /// <summary>
    /// The client1
    /// </summary>
    private string client1;
    /// <summary>
    /// The client2
    /// </summary>
    private string client2;
    /// <summary>
    /// The client3
    /// </summary>
    private string client3;
    /// <summary>
    /// The client4
    /// </summary>
    private string client4;
    /// <summary>
    /// The consultant
    /// </summary>
    private string consultant;
    /// <summary>
    /// An item is being added.
    /// </summary>
    /// <param name="properties">The Item Event properties</param>
    public override void ItemAdded(SPItemEventProperties properties)
    //this.EventFiringEnabled = false;
    var web = properties.Web;
    var listItem = properties.ListItem;
    try
    LogIssue(web, null, "Item Added", "List Item Id {0}", listItem.ID);
    if (!this.AttemptCopyProcess(listItem))
    LogIssue(web, null, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
    catch (Exception ex)
    LogIssue(web, ex, "List Id : " + listItem.ID, "AttemptCopyProcess failed.");
    finally
    //this.EventFiringEnabled = true;
    LogIssue(web, null, "List Id : " + listItem.ID, "Event Receiver completed sucessfully.");
    /// <summary>
    /// Logs any issues found
    /// </summary>
    /// <param name="webContext">The web context.</param>
    /// <param name="exception">The exception, if null not exception details are written</param>
    /// <param name="contextId">The context identifier, a unique identifier that allows us to know where the call originated, i.e. a List and ListItem Id, or a Page Url</param>
    /// <param name="comment">The comment.</param>
    /// <param name="args">The arguments.</param>
    private static void LogIssue(SPWeb webContext, Exception exception, string contextId, string comment, params object[] args)
    //// if (webContext.AllProperties.ContainsKey("EnableLogging"))
    var list = webContext.Lists.TryGetList("ErrorIssues");
    if (list != null)
    var item = list.AddItem();
    item["Title"] = contextId;
    if (exception != null)
    item["Message"] = exception.Message;
    item["InnerException"] = exception.InnerException ?? (object)string.Empty;
    item["StackTrace"] = exception.StackTrace;
    if (!string.IsNullOrEmpty(comment))
    item["Comment"] = string.Format(comment, args);
    item.Update();
    /// <summary>
    /// Assigns the field.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>The fields string value if present, otherwise string.empty.</returns>
    private static string AssignField(SPListItem listItem, string fieldName, string contextId)
    var fieldValue = string.Empty;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    fieldValue = listItem[fieldName].ToString();
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return fieldValue;
    /// <summary>
    /// Assigns the field as a DateTime
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>Returns the date if found, otherwise returns DateTime.MinValue</returns>
    private static DateTime? AssignDateField(SPListItem listItem, string fieldName, string contextId)
    DateTime? fieldValue = null;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    fieldValue = Convert.ToDateTime(listItem[fieldName].ToString());
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return fieldValue;
    /// <summary>
    /// Creates the folder.
    /// </summary>
    /// <param name="listdoc">The list.</param>
    /// <param name="folderName">Name of the folder.</param>
    private static void CreateFolder(SPList listdoc, string folderName)
    LogIssue(listdoc.ParentWeb, null, "List Id : " + listdoc.ID, "Creating folder {0} in {1}", folderName, listdoc.RootFolder.ServerRelativeUrl);
    // Updated by Indusnet
    SPListItem folder1 = listdoc.Items.Add(listdoc.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder);
    folder1["Name"] = folderName;
    folder1.Update();
    listdoc.Update();
    // End Updated
    /// <summary>
    /// Assigns the user field.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="fieldName">Name of the field.</param>
    /// <param name="contextId">The context identifier.</param>
    /// <returns>Returns the user if found, otherwise null.</returns>
    private static SPUser AssignUserField(SPListItem listItem, string fieldName, string contextId)
    SPUser user = null;
    if (listItem.Fields.ContainsField(fieldName) && listItem[fieldName] != null)
    var userField = (SPFieldUser)listItem.Fields.GetField(fieldName);
    var fieldValue = (SPFieldUserValue)userField.GetFieldValue(listItem["electrical_proj_manager"].ToString());
    user = fieldValue.User;
    else
    LogIssue(listItem.Web, null, contextId, string.Format("Field not available : {0}", fieldName));
    return user;
    /// <summary>
    /// Attempts the copy process.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <returns>True if it successfully processed, false otherwise.</returns>
    private bool AttemptCopyProcess(SPListItem listItem)
    if (listItem.ParentList.Title != "Enquiry_Template")
    LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "ListItem titles is not Enquiry_Template, aborting.");
    return false;
    var finalNum = "15-" + new Random().Next(0, 9999).ToString("D4");
    this.Initialize(listItem, finalNum);
    if (this.noBid != "Yes")
    LogIssue(listItem.Web, null, "List Id : " + listItem.ID, "The noBid field does not equal Yes, aborting.");
    return false;
    this.CopyFiles(listItem.Web, finalNum);
    this.CreateFolders(listItem.Web);
    return true;
    /// <summary>
    /// Copies the files.
    /// </summary>
    /// <param name="web">The web.</param>
    /// <param name="finalNum">The final number.</param>
    private void CopyFiles(SPWeb web, string finalNum)
    LogIssue(web, null, "Web Id : " + web.ID, "Setting the copying of files ...");
    var mechanicalQuoteList = web.Lists["Quotation Analysis Mechanical"];
    var electricalQuoteList = web.Lists["Quotation Analysis Electrical"];
    var tenderSummarList = web.Lists["TenderSummaryLib"];
    var estimatingList = web.Lists["EstimatingRFI"];
    var tenderSheduleList = web.Lists["Tender and Drawing Schedule"];
    var tenderPricingList = web.Lists["Est_Tender_Pricing_Document"];
    var url1 = mechanicalQuoteList.RootFolder.ServerRelativeUrl;
    var url = electricalQuoteList.RootFolder.ServerRelativeUrl;
    var url2 = tenderSummarList.RootFolder.ServerRelativeUrl;
    var urlA = estimatingList.RootFolder.ServerRelativeUrl;
    var urlB = tenderSheduleList.RootFolder.ServerRelativeUrl;
    var urlC = tenderPricingList.RootFolder.ServerRelativeUrl;
    var foldername1 = string.Empty;
    var foldername = string.Empty;
    var foldername2 = string.Empty;
    var foldernameA = string.Empty;
    var foldernameB = string.Empty;
    var foldernameC = string.Empty;
    var folder1 = web.Folders[url1 + "/" + foldername1];
    var folder = web.Folders[url + "/" + foldername];
    var folder2 = web.Folders[url2 + "/" + foldername2];
    var folderA = web.Folders[urlA + "/" + foldernameA];
    var folderB = web.Folders[urlB + "/" + foldernameB];
    var folderC = web.Folders[urlC + "/" + foldernameC];
    if (!folder1.Exists && !folder.Exists && !folder2.Exists && !folderA.Exists && !folderB.Exists && !folderC.Exists)
    var folders1 = web.GetFolder(url1).SubFolders;
    var folders = web.GetFolder(url).SubFolders;
    var folders2 = web.GetFolder(url2).SubFolders;
    var foldersA = web.GetFolder(urlA).SubFolders;
    var foldersB = web.GetFolder(urlB).SubFolders;
    var foldersC = web.GetFolder(urlC).SubFolders;
    folders1.Add(foldername1);
    folders.Add(foldername);
    folders2.Add(foldername2);
    foldersA.Add(foldernameA);
    foldersB.Add(foldernameB);
    foldersC.Add(foldernameC);
    var file1 = web.GetFile(web.Site.Url + TemplateUrl1);
    var file = web.GetFile(web.Site.Url + TemplateUrl);
    var file2 = web.GetFile(web.Site.Url + TemplateUrl2);
    var fileA = web.GetFile(web.Site.Url + RfiTemplateUrl);
    var fileB = web.GetFile(web.Site.Url + DrawingTemplateUrl);
    var fileC = web.GetFile(web.Site.Url + TenderReturnTemplateUrl);
    if (file1 != null && file != null && file2 != null && fileA != null && fileB != null && fileC != null)
    var fileName = string.Format("{0}/{1}{2}", folder1.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 1 {0} to {1}...", file1.Name, fileName);
    var byteArray1 = file1.OpenBinary();
    var uploadedFile1 = folder1.Files.Add(fileName, byteArray1, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 1 Uploaded with new ID of {0}", uploadedFile1.Item.ID);
    this.EventFiringEnabled = false;
    var listitem1 = uploadedFile1.Item;
    listitem1["Name"] = this.projectName;
    listitem1["EnquiryNo"] = finalNum;
    listitem1["Project_Name"] = this.projectName;
    listitem1["Tender_Received"] = this.tenderReceived;
    listitem1["Tender_Return"] = this.tenderReturn;
    listitem1["Quotation_Analysis_Mech_Url"] = "https://my site url/Quotation%20Analysis%20Mechanical/Forms/DispForm.aspx?ID=" + listitem1.ID;
    listitem1.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 1.");
    fileName = string.Format("{0}/{1}{2}", folder.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 2 {0} to {1}...", file.Name, fileName);
    var byteArray = file.OpenBinary();
    var uploadedFile = folder.Files.Add(fileName, byteArray, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 2 Uploaded with new ID of {0}", uploadedFile.Item.ID);
    this.EventFiringEnabled = false;
    var listitem = uploadedFile.Item;
    listitem["Name"] = this.projectName;
    listitem["EnquiryNo"] = finalNum;
    listitem["Project_Name"] = this.projectName;
    listitem["Tender_Received"] = this.tenderReceived;
    listitem["Tender_Return"] = this.tenderReturn;
    listitem["Quotation_Analysis_Elec_Url"] = "https://my site url/Quotation%20Analysis%20Electrical/Forms/DispForm.aspx?ID=" + listitem.ID;
    listitem.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 2.");
    fileName = string.Format("{0}/{1}{2}", folderA.ServerRelativeUrl, this.projectName, ".docx");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 3 {0} to {1}...", fileA.Name, fileName);
    var byteArrayA = fileA.OpenBinary();
    var uploadedFileA = folderA.Files.Add(fileName, byteArrayA, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 3 Uploaded with new ID of {0}", uploadedFileA.Item.ID);
    this.EventFiringEnabled = false;
    var listitemA = uploadedFileA.Item;
    listitemA["Name"] = this.projectName;
    listitemA["EnquiryNo"] = finalNum;
    listitemA["Project_Name"] = this.projectName;
    listitemA["Date"] = this.docDate;
    listitemA["Description"] = this.description;
    listitemA["ProjectNo"] = this.projectNumber;
    listitemA["RFIUrl"] = "https://my site url/EstimatingRFI/Forms/DispForm.aspx?ID=" + listitemA.ID;
    listitemA.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 3.");
    fileName = string.Format("{0}/{1}{2}", folderB.ServerRelativeUrl, this.projectName, ".docx");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 4 {0} to {1}...", fileB.Name, fileName);
    var byteArrayB = fileB.OpenBinary();
    var uploadedFileB = folderB.Files.Add(fileName, byteArrayB, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 4 Uploaded with new ID of {0}", uploadedFileB.Item.ID);
    this.EventFiringEnabled = false;
    var listitemB = uploadedFileB.Item;
    listitemB["Name"] = this.projectName;
    listitemB["EnquiryNo"] = finalNum;
    listitemB["Project_Name"] = this.projectName;
    listitemB["Date"] = this.docDate;
    listitemB["Description"] = this.description;
    listitemB["ProjectNo"] = this.projectNumber;
    listitemB["DrawingURL"] = "https://my site url/Tender%20and%20Drawing%20Schedule/Forms/DispForm.aspx?ID=" + listitemB.ID;
    listitemB.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 4.");
    fileName = string.Format("{0}/{1}{2}", folderC.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", fileC.Name, fileName);
    var byteArrayC = fileC.OpenBinary();
    var uploadedFileC = folderC.Files.Add(fileName, byteArrayC, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 5 Uploaded with new ID of {0}", uploadedFileC.Item.ID);
    this.EventFiringEnabled = false;
    var listitemC = uploadedFileC.Item;
    listitemC["Name"] = this.projectName;
    listitemC["EnquiryNo"] = finalNum;
    listitemC["Project_Name"] = this.projectName;
    listitemC["Date"] = this.docDate;
    listitemC["Description"] = this.description;
    listitemC["ProjectNo"] = this.projectNumber;
    listitemC["PricingURL"] = "https://my site url/Est_Tender_Pricing_Document/Forms/DispForm.aspx?ID=" + listitemC.ID;
    listitemC.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 5.");
    fileName = string.Format("{0}/{1}{2}", folder2.ServerRelativeUrl, this.projectName, ".xlsm");
    LogIssue(web, null, "Web Id : " + web.ID, "Copying file 5 {0} to {1}...", file2.Name, fileName);
    var byteArray2 = file2.OpenBinary();
    var uploadedFile2 = folder2.Files.Add(fileName, byteArray2, true);
    LogIssue(web, null, "Web Id : " + web.ID, "File 6 Uploaded with new ID of {0}", uploadedFile2.Item.ID);
    this.EventFiringEnabled = false;
    var listitem2 = uploadedFile2.Item;
    listitem2["Name"] = this.projectName;
    listitem2["EnquiryNo"] = finalNum;
    listitem2["Project_Name"] = this.projectName;
    listitem2["Date"] = this.docDate;
    listitem2["Team"] = this.team;
    listitem2["Estimator_Electrical"] = this.electrical;
    listitem2["Estimator_Mechanical"] = this.mechanical;
    listitem2["Status"] = this.status;
    listitem2["Tender_Received"] = this.tenderReceived;
    listitem2["Tender_Return"] = this.tenderReturn;
    listitem2["Sector"] = this.sector;
    listitem2["Design_Build"] = this.designBuild;
    listitem2["Build_Type"] = this.buildType;
    listitem2["Service_Prog_Start"] = this.serviceProgramStart;
    listitem2["Service_Prog_Completion"] = this.serviceProgramCompletion;
    listitem2["Client_1"] = this.client1;
    listitem2["Client_2"] = this.client2;
    listitem2["Client_3"] = this.client3;
    listitem2["Client_4"] = this.client4;
    listitem2["Consultant"] = this.consultant;
    listitem2["Pre-construction_Prog_Start"] = this.preConstructionProgramStart;
    listitem2["Pre-construction_Prog_End"] = this.preConstructionProgramEnd;
    listitem2["Tender_Summary_Url"] = "https://my site url/TenderSummaryLib/Forms/DispForm.aspx?ID=" + listitem2.ID;
    listitem2.SystemUpdate(false);
    this.EventFiringEnabled = true;
    LogIssue(web, null, "Web Id : " + web.ID, "Copied file 6.");
    /// <summary>
    /// Creates the folders.
    /// </summary>
    /// <param name="web">The web.</param>
    private void CreateFolders(SPWeb web)
    var projectListId = web.Lists.Add(this.projectName.Replace(' ', '_'), string.Empty, SPListTemplateType.DocumentLibrary);
    var projectList = web.Lists[projectListId];
    projectList.OnQuickLaunch = true; // The document library will appear in Quick Launch bar.
    CreateFolder(projectList, "1.Tender Documents");
    CreateFolder(projectList, "2. Electrical");
    CreateFolder(projectList, "3. Mechanical");
    CreateFolder(projectList, "4. Correspondance");
    CreateFolder(projectList, "5. Settlement Meeting Docs");
    CreateFolder(projectList, "6. Tender Return Docs");
    CreateFolder(projectList, "7. Tender Handover");
    projectList.Update();
    /// <summary>
    /// Initializes the specified list item.
    /// </summary>
    /// <param name="listItem">The list item.</param>
    /// <param name="finalNum">The final number.</param>
    private void Initialize(SPListItem listItem, string finalNum)
    var contextId = string.Format("List:{0}, Id:{1}", listItem.ParentList.Title, listItem.ID);
    this.noBid = AssignField(listItem, "Bid", contextId);
    this.projectName = AssignField(listItem, "Project_Name", contextId);
    var teamlookup = AssignField(listItem, "Team", contextId);
    var lookupParts = teamlookup.Split(new[] { ";#" }, StringSplitOptions.None);
    this.team = lookupParts[1];
    this.description = AssignField(listItem, "Description", contextId);
    this.status = AssignField(listItem, "enquiry_status", contextId);
    this.electrical = AssignUserField(listItem, "electrical_proj_manager", contextId);
    this.mechanical = AssignUserField(listItem, "mechanical_proj_manager", contextId);
    this.docDate = AssignDateField(listItem, "Date", contextId);
    this.tenderReceived = AssignDateField(listItem, "Tender_Received", contextId);
    this.tenderReturn = AssignDateField(listItem, "Tender_Return", contextId);
    this.preConstructionProgramStart = AssignDateField(listItem, "Pre-construction_Prog_Start", contextId);
    this.preConstructionProgramEnd = AssignDateField(listItem, "Pre-construction_Prog_End", contextId);
    this.sector = AssignField(listItem, "Sector", contextId);
    this.designBuild = AssignField(listItem, "Design_Build", contextId);
    this.buildType = AssignField(listItem, "Build_Type", contextId);
    this.serviceProgramStart = AssignDateField(listItem, "Service_Prog_Start", contextId);
    this.serviceProgramCompletion = AssignDateField(listItem, "Service_Prog_Completion", contextId);
    this.client1 = AssignField(listItem, "Client_1", contextId);
    this.client2 = AssignField(listItem, "Client_2", contextId);
    this.client3 = AssignField(listItem, "Client_3", contextId);
    this.client4 = AssignField(listItem, "Client_4", contextId);
    this.consultant = AssignField(listItem, "Consultant", contextId);
    if (this.status == "Won")
    this.projectNumber = string.Format("15-{0}-{1}", this.team, new Random().Next(0, 9999).ToString("D4"));
    if (this.status == "Active" || this.status == "Closed")
    this.projectNumber = "No Project No";
    listItem["ProjectNo"] = this.projectNumber;
    listItem["EnquiryNo"] = finalNum;
    listItem.Web.AllowUnsafeUpdates = true;
    listItem.SystemUpdate(false);

    Hi,
    In this forum we mainly discuss questions and feedbacks about Office client products, as your question is about SharePoint 2013, I suggest you post this thread in SharePoint forum:
    https://social.technet.microsoft.com/Forums/office/en-US/home?category=sharepoint
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Sharepoint 2013, event receiver to rename files not working

    I coded an event receiver (ItemAdding) that renames for example a .txt file to a .text file (it does not matter the extensions, it is just an example). In my code what I do is to an SPFile.MoveTo operation. It works fine in SP2010 but when I execute
    the same code in SP 2013, when the operation is done using IE I get the text "Sorry, something went wrong" and then "File Not Found".
    In the logs this is what I see:
    12/23/2013 15:48:49.16  w3wp.exe (0x17B0)                        0x0AC8 SharePoint Foundation        
     General                        ai1wu Medium   System.IO.FileNotFoundException: The system cannot find the file specified.
    (Exception from HRESULT: 0x80070002), StackTrace:    at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(String strUrl, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)     at Microsoft.SharePoint.SPFile.PropertiesCore(Boolean
    throwException)     at Microsoft.SharePoint.SPFile.get_Length()     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadPage.OnSubmit(Object o, EventArgs e)     at Microsoft.Office.RecordsManagement.PolicyFeatures.ApplicationPages.UploadExPage.OnSubmit(Object
    o, EventArgs e)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     at System.Web.UI.Page.ProcessReque... f72b639c-77b1-5045-c3a2-b23f24ae71c0
    It's clear that the Sharepoint upload code tries to do things with the original name and it does not realize that it was renamed.
    Can I do something from my event receiver code like using the AfterProperties to bypass this error?
    Thanks

    Hi Dennis,
    The issue still persists. Here is the code:
            public override void ItemAdded(SPItemEventProperties properties)
                SPSecurity.RunWithElevatedPrivileges(delegate()
                    try
                        OutputDebugStringA("Inside ItemAdded");
                        string szHttpUrl = properties.WebUrl + "/" + properties.AfterUrl;
                        SPWeb openedWeb = properties.Web.Site.OpenWeb(properties.Web.ID);
                        SPFile spf = openedWeb.GetFile(szHttpUrl);
                        EventFiringEnabled = false;
                        string szUrl = properties.AfterUrl;
                        szUrl = szUrl + ".renamed";
                        string szNewFileName;
                        if (szUrl.LastIndexOf('\\') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('\\') + 1);
                        else if (szUrl.LastIndexOf('/') != -1) szNewFileName = szUrl.Substring(szUrl.LastIndexOf('/') + 1);
                        else szNewFileName = szUrl;
                        if (properties.ListItem != null)
                            properties.ListItem["Title"] = szNewFileName;
                            properties.ListItem.Update();
                        spf.MoveTo(szUrl);
                        EventFiringEnabled = true;
                        base.ItemAdded(properties);
                        OutputDebugStringA("Renaming to " + szUrl);
                    catch (System.Exception exception)
                        OutputDebugStringA("ItemAdded ERROR: " + exception.ToString());

  • Deploying SSRS Reports to SharePoint 2013 Result in Error

    We are trying to deploy SSRS reports developed in VS 2012 to SharePoint 2013.  Whenever any user deploys the report, they receive the following error. 
    Error 1
    Report Server has encountered a SharePoint error. ---> 
    Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: Report Server has encountered a SharePoint error. ---> 
    Microsoft.SharePoint.SPException: The list item could not be added or updated because duplicate values were found in one or more fields in the list. ---> 
    System.Runtime.InteropServices.COMException: The list item could not be added or updated because duplicate values were found in one or more fields in the list.
    Has anyone received this error and know of a solution?
    Thanks in advance for your assistance.

    Hi jbud55,
    According to your description, my understanding is that there is an error when you deployed SSRS via to SharePoint 2013.
    This error displays that there is a column that does not allow duplicate value in the list. So, please check the list columns.
    In addition, as this issue related to SSRS, you can also create a new thread on SQL Reporting Serivces forum, more experts will assist you with SSRS.
    SSRS forum:
    http://social.technet.microsoft.com/Forums/en-US/home?forum=sqlreportingservices
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Deploying simple SharePoint 2013 feature causing error: "Error occurred in deployment step 'Add Solution': An unknown exception occurred while executing a sandboxed code solution request in the worker process."

    When trying to deploy a sandboxed solution containing only a feature with a simple associated event receiver from VS 2013, I'm getting the following error:
    Error occurred in deployment step 'Add Solution': An unknown exception occurred while executing a sandboxed code solution request in the worker process.\r\n|0
    I'm working in Visual Studio 2013, deploying to SharePoint 2013.
    The SharePoint project is very basic. I've only added a feature and an associated event receiver. It works without the event receiver. Then after I simply add the event receiver I get the error.
    I've tried deploying directly from VS 2013 as well as publishing to a .WSP and uploading via web interface. Same error reported using both methods. I'm doing this using an Administrator account that I've confirmed is a site collection administrator.
    Additionally, I've found that if I change Sandboxed Solution to False, deploy it, retract it, then change Sandboxed Solution back to True, then I can successfully deploy it. But this doesn't seem to be a permanent solution as the error will resurface a day
    or two later...

    Hi Steve,
    Are you running your SharePoint 2013 on domain controller? 
    http://www.learningsharepoint.com/2013/08/09/sharepoint-2013-error-an-unknown-exception-occurred-while-executing-a-sandboxed-code-solution-request-in-the-worker-process-rn0/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/b7408608-c21b-45d9-bc16-e6afff510cd2/installed-sharepoint-2013-foundation-on-window-2010-server-issues-activating-sandbox-solutions?forum=sharepointadmin
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • SharePoint 2013 Reporting Services Error activating ReportingWebService.svc

    I get below error when i tried accessing System Settings after creating Reporting Services Service Application in SharePoint 2013, looked in to many blogs but didn't find any fix
    tried https://social.msdn.microsoft.com/forums/sqlserver/en-US/c2066c96-d8d0-46b5-89ff-abd806b3169d/reportingwebservicesvc-could-not-be-activated
    tried http://sharepointconnoisseur.blogspot.com/2014/07/how-to-resolve-requested-service-http.html
    and also tried http://sharepoint.stackexchange.com/questions/80118/sharepoint-2010-reporting-services-integration-set-server-defaults-error
    but nothing worked
    The Error is:
    The requested service, 'http://localhost:32843/99f510a2628e4f24a5dbde00a57f0cbb/ReportingWebService.svc' could not be activated. See the server's diagnostic trace logs for more information.
    Error Log:
    Application error when access /_admin/ReportServer/ReportingServicesSystemSettings.aspx, Error=The requested service, 'http://localhost:32843/9a9f58cdb5b34551921277056e5ebc82/ReportingWebService.svc' could not be activated. See the server's diagnostic trace
    logs for more information.  Server stack trace:     
     at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)    
     at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)    
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)    
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown
     at [0]:     
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)    
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)    
     at Microsoft.ReportingServices.ServiceContract.IReportServiceManagement.GetSystemProperties(ICollection`1 properties)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.<>c__DisplayClass9.<GetSystemProperties>b__8(IReportServiceManagement mchannel)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.DoManagementChannelCall(Action`1 caller)    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.get_SystemProperties()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.LoadSettings()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.OnInit(EventArgs e)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    System.ServiceModel.ServiceActivationException: The requested service, 'http://localhost:32843/9a9f58cdb5b34551921277056e5ebc82/ReportingWebService.svc' could not be activated. See the server's diagnostic trace logs for more information.   Server stack
    trace:     
     at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)    
     at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)    
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)    
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown
     at [0]:     
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)    
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)    
     at Microsoft.ReportingServices.ServiceContract.IReportServiceManagement.GetSystemProperties(ICollection`1 properties)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.<>c__DisplayClass9.<GetSystemProperties>b__8(IReportServiceManagement mchannel)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.DoManagementChannelCall(Action`1 caller)    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.get_SystemProperties()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.LoadSettings()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.OnInit(EventArgs e)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ServiceModel.ServiceActivationException: The requested service, 'http://localhost:32843/9a9f58cdb5b34551921277056e5ebc82/ReportingWebService.svc'
    could not be activated. See the server's diagnostic trace logs for more information.    Server stack trace:     
     at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)    
     at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)    
     at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)    
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)    
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)    Exception rethrown
     at [0]:     
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)    
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)    
     at Microsoft.ReportingServices.ServiceContract.IReportServiceManagement.GetSystemProperties(ICollection`1 properties)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.<>c__DisplayClass9.<GetSystemProperties>b__8(IReportServiceManagement mchannel)    
     at Microsoft.ReportingServices.SharePoint.SharedService.ProxyHelper.DoManagementChannelCall(Action`1 caller)    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.get_SystemProperties()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.LoadSettings()    
     at Microsoft.ReportingServices.SharePoint.SharedService.UI.ReportingServicesSystemSettings.OnInit(EventArgs e)    
     at System.Web.UI.Control.InitRecursive(Control namingContainer)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.HandleError(Exception e)    
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    
     at System.Web.UI.Page.ProcessRequest()    
     at System.Web.UI.Page.ProcessRequest(HttpContext context)    
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    Hi,
    From your description, my understanding is that you got an error when you clicked System settings after configuring Reporting Services service application.
    What size did you use for the memory? Please make sure the server has enough memory to run SharePoint and all services.
    In addition, please open
    http://localhost:xxxxx/SecurityTokenServiceApplication/securitytoken.svc to check if there is something about this issue.
    Here is a similar post about this issue, please take a look at:
    http://whitepages.unlimitedviz.com/2012/07/setting-up-reporting-services-2012-with-sharepoint-2013/
    As this issue is about Reporting Services, I suggest you create a new thread on SSRS forum, more experts will assist you with SSRS.
    SSRS forum:
    https://social.technet.microsoft.com/Forums/office/en-US/home?forum=sqlreportingservices
    Best Regards,
    Wendy
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Trying to open PowerView on SharePoint 2013 throws an error

    Hello,
    I am having some serious issues with a vanilla install of SharePoint 2013 in a dev environment.
    SQL and SharePoint are in different servers.
    I installed PowerPivot in the SQL Server, then I proceeded to run the PowerPivot configurator in the SharePoint server.
    The configurator proceeded to validate and setup PowerPivot in a site-collection of my choice (a BI Service Center site). It seems like it completed withou any errors.
    I manage to create a PowerPivot sub-site without any issues.
    I can use Excel services without any issues (so far).
    I can create semantic models pointing to Excel files or databases at the remote SQL server without any issues.
    However if I try create a PowerView report, the system immediately returns me a "something went wrong" error page. By looking at the correlation, here is what I found:
    05/30/2014 09:23:27.91 w3wp.exe (0x17F8) 0x14D0 SharePoint Foundation General 8nca Medium Application error when access /_layouts/15/ReportServer/AdHocReportDesigner.aspx, Error=The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) dce9959c-be60-c01b-816f-31db0b5da281
    05/30/2014 09:23:27.91 w3wp.exe (0x17F8) 0x14D0 SharePoint Foundation Runtime tkau Unexpected System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) dce9959c-be60-c01b-816f-31db0b5da281
    05/30/2014 09:23:27.91 w3wp.exe (0x17F8) 0x14D0 SharePoint Foundation General ajlz0 High Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.ReportingServices.SharePoint.SharedService.Client.RecoverableCommunicationException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IIS 8.0 Detailed Error - 500.19 - Internal Server Error</title> <style type="text/css"> <!-- body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 5px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;word-break:break-all;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px; font-weight:bold;font-size:1em;} a:link,a:visited{color:#007EFF;font-weight:bold;} a:hover{text-decoration:none;} h1{font-size:2.4em;margin:0;color:#FFF;} h2{font-size:1.7em;margin:0'. ---> System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>IIS 8.0 Detailed Error - 500.19 - Internal Server Error</title> <style type="text/css"> <!-- body{margin:0;font-size:.7em;font-family:Verdana,Arial,Helvetica,sans-serif;} code{margin:0;color:#006600;font-size:1.1em;font-weight:bold;} .config_source code{font-size:.8em;color:#000000;} pre{margin:0;font-size:1.4em;word-wrap:break-word;} ul,ol{margin:10px 0 10px 5px;} ul.first,ol.first{margin-top:5px;} fieldset{padding:0 15px 10px 15px;word-break:break-all;} .summary-container fieldset{padding-bottom:5px;margin-top:4px;} legend.no-expand-all{padding:2px 15px 4px 10px;margin:0 0 0 -12px;} legend{color:#333333;;margin:4px 0 8px -12px;_margin-top:0px; font-weight:bold;font-size:1em;} a:link,a:visited{color:#007EFF;font-weight:bold;} a:hover{text-decoration:none;} h1{font-size:2.4em;margin:0;color:#FFF;} h2{font-size:1.7em;margin:0'. ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding) at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Microsoft.ReportingServices.ServiceContract.IReportServiceManagement.get_IsWebServiceEnabled() at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.<>c__DisplayClass8`1.<ExecuteOnApplication>b__6(IReportServiceManagement proxy, Int32 dummy) at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.ExecuteOnChannel[T](String siteUrl, String xmlNamespace, Action`2 method, IChannel channel, Int32 maxFaultSize) at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.HandleExecuteOnChannel[T](String siteUrl, String xmlNamespace, Action`2 method, SPServiceLoadBalancerContext loadBalancerContext) --- End of inner exception stack trace --- at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.HandleExecuteOnChannel[T](String siteUrl, String xmlNamespace, Action`2 method, SPServiceLoadBalancerContext loadBalancerContext) at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.ExecuteOnApplication[T](String operationName, String siteUrl, String xmlNamespace, Action`2 method) at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceApplicationProxy.Invoke[T](SPServiceContext serviceContext, String operationName, String siteUrl, String xmlNamespace, Guid serviceInstanceId, Action`2 method) at Microsoft.ReportingServices.SharePoint.SharedService.Client.ReportingWebServiceClient.Execute[TResult](String methodName, Func`2 action) at Microsoft.ReportingServices.SharePoint.UI.ReportingServiceAppConnection.Microsoft.ReportingServices.RsProxy.IRSConnection.GetServerInfoHeader() at Microsoft.ReportingServices.RsProxy.SrvProxy.get_ServerInfoHeader() at Microsoft.ReportingServices.SharePoint.UI.RSError.HandleUnsupportedRSEdition(SrvProxy proxy, RestrictedFeatures feature, Boolean throwInsteadOfRedirect) at Microsoft.ReportingServices.SharePoint.UI.AdHocReportDesigner.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) dce9959c-be60-c01b-816f-31db0b5da281
    Looks like there is something wrong with a web service, perhaps? Has anyone ever experienced such issue before? Should I try to run the PowerPivot configurator to repair the installation?
    I am wondering if there is a better way to troubleshoot this. Or even better is someone has a direct solution to this problem :)
    Thanks in advance for the help.
    Regards,
    P.

    Upon investigating further I found out that the issue here is because there are files related to SSRS webservices which are missing.
    Apparently, installing the SSRS in SharePoint mode at the SharePoint server solves the issue.
    My confusion is around the fact that there is an SSRS add-in for SharePoint which is separate from the installation of SSRS in SharePoint mode. This led me to conclude that the SSRS in SharePoint mode should be installed on my SQL Server, while the add-in
    should be installed on the SharePoint server. It never occurred to me that SSRS SharePoint mode should be installed in the SharePoint server.
    In fact, this still does not make sense to me and while I can understand that installing SSRS at the SharePoint server is a quick way to fix the issue, there must be a
    cleaner way to do this that separates that allows SSRS to be installed on a server different than SharePoint. Otherwise, why would MSFT provide the SSRS SharePoint add-in as a separate set-up?
    Cheers,
    P.

  • SharePoint 2013 web service: Error while sending claim based authentication request (The corresponding SID in the domain is not part of the intended account type)

    We are using .asmx services for SharePoint features such as comments, and rating.
    Service
    Feature   used
    http://<<hostname>>/_vti_bin/socialdataservice.asmx
    Commenting, Rating
    http://<<hostname>>/_vti_bin/UserProfileService.asmx
    For out of box workflows
    In SharePoint 2013,
    SharePoint – 80  web application is on claims based mode and user is logging in with windows authentication. With logged-in client context used to call SharePoint's default web service, we are getting below error message from
    web service (Social data and user profile services).
    Server was unable to process request. ---> The corresponding SID in the domain is not part of the intended account type.
    When the service is accessed using console application with Visual Studio credentials (logged in user), we are able to access the service. Below is the code snippet
    using   (SocialDataService
    service = new  
    SocialDataService())
                      service.Credentials =
    CredentialCache.DefaultCredentials;
    SocialCommentDetail detail =   service.AddComment("<<url>>",
      "Test Comment",
    null,  
    null);
    Are SharePoint 2013 web services not supporting request coming with claim based authentication web application?
    Thanks, Pratik Agrawal (MAQ Software)

    While this applies to 2010, I believe the same is true with 2013:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/925e5f46-317f-46d3-bc55-c67f07eb2372/call-sharepoint-web-services-using-claimbased-authentication?forum=sharepointgeneralprevious
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Sharepoint 2013 explorer view error - problem opening this location in file explorer (HTTPS + Win7 Enterprise 64 bit + IE9 32 bit + Office 2007 32 bit)

    Hi,
    We have a problem using Sharepoint 2013 explorer view. (Error - We're having a problem opening this location in file explorer. Add this web site to your trusted sites list and try again).
    I'm using Windows 7 Enterprise 64 bit, Office 2007 32 bit and IE9 32 bit. And the sharepoint site is a https site.
    Some people in my organization are able to browse and some users getting the above error. (with the same client machine configuration)
    If I clear my browser cache, closes the browser and open it then the explorer view is working. But after a minute if I try again I'm getting the above mentioned error. This 1 minute expiration happens is since the first time I have used explorer
    view, not since I opened the browser.
    I have tried the following on my machine:
    1. Modified the web client service to run automatically.
    2. Verified the sharepoint site is part of trusted sites (https://*.spsite.com/)
    3. Compatibility mode is turned on.
    4. Tried adding
    AuthForwardServerList in the webclient registry settings under parameters. (restarted the web client)
    5. Verified the BasicAuthLevel set to 1 (since we are using SSL). Tried setting the BasicAuthLevel to 2 as well. (restarted the web client)
    6. Tried installing software update for web folders (KB907306).
    Verified the below on the production server:
    1. The web application has the root site collection.
    2. It has WebDav Publishing disabled under IIS Web Server feature.
    Could some one please help me in resolving this issue?
    Thanks.

    Hi  Deepak,
    According to your post, my understanding is that you failed to use "Open with Explorer"  in a document library.
    For your issue, please verify the following:
    ActiveX controls must be enabled in IE.
    As you are using Windows 7 Server as the client computer, you must install the Desktop Experience feature from Server Manager.
    Make sure there is a working Root site collection.
    Install this hotfix for windows 7 work with sharepoint 2013 :hotfixv4.microsoft.com/.../463266_intl_x64_zip.exe
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Search not working in SharePoint 2013 - Event ID 1314 - Crawler:Gatherer Plugin

    I have one web application and three host-named site collections. I had read an article that I just need to have the web application URL in the content source for the search to work, but that didn't resolve my issue.
    https://webapplication - main root web application
    https://staff.domain.com - Host name site collection
    https://services.domain.com Host name site collection
    https://sharepoint.domain.com host name site collection.
    I have also created the registry entry for BackConnectionHostNames also.
    Under Search Application topology I have all green check marks, but searchable items are listed as 0.
    I am getting the following errors on my SharePoint 2013 server.
    The start address https://sharepoint.domain.com cannot be crawled.
    Context: Application 'Connect_Search', Catalog 'Portal_Content'
    Details:
    This URL is part of a host header SharePoint deployment and the search application is not configured to crawl individual host header sites. This will be crawled as a part of the host header Web application if configured as a start address.  
    (0x80040de4)
    The start address https://webapplication cannot be crawled.
    Context: Application 'sharepoint_Search', Catalog 'Portal_Content'
    Details:
    The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled.   (0x80041223)
    The start address https://services.domain.com cannot be crawled.
    Context: Application 'sharepoint_Search', Catalog 'Portal_Content'
    Details:
    This URL is part of a host header SharePoint deployment and the search application is not configured to crawl individual host header sites. This will be crawled as a part of the host header Web application if configured as a start address.  
    (0x80040de4
    The start address https://staff.domain.com cannot be crawled.
    Context: Application 'Sharepoint_Search', Catalog 'Portal_Content'
    Details:
    This URL is part of a host header SharePoint deployment and the search application is not configured to crawl individual host header sites. This will be crawled as a part of the host header Web application if configured as a start address.  
    (0x80040de4)
    any help would be greatly appreciated.

    Hello Derek,
    as I see you are using Host Named Site Collections.
    You have two Problems.
    First:
    The start address https://webapplication cannot be crawled.
    Context: Application 'sharepoint_Search', Catalog 'Portal_Content'
    Details:
    The secure sockets layer (SSL) certificate sent by the server was invalid and this item will not be crawled.   (0x80041223)
    You Need to fix this first!! You have a Problem with your SSL Certificate!
    The Webapplication is where normally the Search Crawler would enter the crawl in a Host Named Site Collection Scenario.
    As soon as you fix this, remove the entries for your Host Named Site Collections from the Crawler. Just leave your Webapplication in it. The HNSC will be crawled automatically. This is the following of your Errors:
    The start address https://services.domain.com cannot be crawled.
    Context: Application 'sharepoint_Search', Catalog 'Portal_Content'
    Details:
    This URL is part of a host header SharePoint deployment and the search application is not configured to crawl individual host header sites. This will be crawled as a part of the host header Web application if configured as a start address.  
    (0x80040de4
    Be sure that you created your Webapplication NOT
    AS A HOST NAMED WEB APPLICATION!
    If you can check everything I mentioned above, your search should hopefully start to work.
    King regards!

  • Sharepoint 2013 Publish ContentHub Error Metadata web service application proxy Metadata Service Application Proxy.

    I'm trying to republish the content hub but getting mms errors. I checked the coorlation id but make no sense of it. Any help would be appreciated. 

    Hi,
    According to your post, my understanding is that you failed to republish the content hub.
    I recommend to execute the following PowerShell command to add all permissions needed:
    Initialize-SPResourceSecurity
    In addition, you can create a new managed metadata service application and also a new application pool account to check whether it works.
    More information:
    Troubleshooting “The Managed Metadata Service or Connection is currently not available in SharePoint
    2013”
     Upgrade Managed Metadata Service App
    Migrate Managed Metadata Service to SharePoint 2013 error
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • All the Event receivers getting fired in SharePoint 2010 Event receiver Solution

    Hi friend.
    I have two event receivers. both are deployed as Farm Solution with Site as scope.
    ER1=> This event receiver is attached to Form Library and I have changed it's URL in Element.xml ListUrl as Listurl="TimeLog/Forms"
    ER2=> This event receiver is attached to Custom list and I have changed its Url in Element.xml as ListUrl="Lists/MyList"
    Both the Event receiver have ItemUpdated Event
    Here TimeLog is name of Form Library where I log time and MyList is name of custom list.
    Event Receivers are deployed to my Root site but I have page to redirect to other site collection which are under root site which contains my list and library. (Note: I dont have any list and library on my root site)
    Http://myportal/
    and I have other site collections
    http://myportal/sites/A
    http://myportal/Sites/B and so on..
    When I activate both the Event Receiver feature in SiteCollection "A" and updates some value in myList both the event receiver get fired and logs are generate.
    Can some one help me out to get only relevant event receiver get fired.  
    Thanks & Regards
    Gireesh Painuly

    Thanks all for your response.
    I identified the problem but did not find any solution. I would like to elaborate my requirement in detail:
    1- My Site collection structure is as below
    a. http://SP13/  => my root site as team site
    b. http://SP13/Sites/Client1
    c. http://SP13/Sites/Client 2    ..... and so on.. with same URL pattern.  
    1- I have created a SharePoint 2014 Empty SharePoint solution as Farm solution ( Because I have multiple site collection in a web application which perform same operation but belong to different clients)
    2- I added two Event Receivers in in this solution name ER1 and ER2
    3- I created two features ER1-Feature and ER2-Feature these feature contain related ER1(ER1-Feature) and ER2(ER2-Feature) i.e one feature contains ER1 and another feature contains ER2. Both of these features have scope=Site because I don't have any list
    and library at Root site that's why scope has not set to Web level.
    4. I created two list ERList1 and ERList2 for respected ER's i.e ERList1 for ER1 and ERList2 for ER2
    5. Both ER1 and ER2 has two methods ie. Item was Added and Item was Updated. I have just written code in these methods to create a text file to check which event receiver get called. I am not updating any list or library in these event.
    6. While creating Event Receiver I have selected Custom List as the source for triggering Event. but I modified Element.xml file of both the Receiver as below:
       A. ListUrl="Lists/ERList1" => in ER1 for ERList1 List
       B. ListUrl="Lists/ERList1" => in ER2 for ERList2 List.
    7. I Deployed my Solution to my root site ie Http://SP13/
    8. Now when I go to http://SP13/Sites/Client1 and open the ErList1. after adding a record in this list.. I get two log files generated in my drive that is ER1Executed.txt and ER2Executed.txt ( These files are generated by code which I have written in my
    ItemAdded and ItemUpdated methods of both ER1 and ER2 respectively
    9. Same two files are generate if i add any itme in ERList2 as well.
    10. But I identified it by creating both of these list at my root site to check whether tow file get created or not. but here it works fine just creates respected file. it means on related event receiver get fir as it should.
    So conclusion: 
    when Event receiver is activated in http://SP13/Sites/Client1 it creates two files mens ER is not able to find the list url properly. because in child site collection url get changed
    http://SP13/sites/client1/Lists/Erlist1
    How can I fix the URL in Element.xml so that related Event Receiver gets fired. I have multipla project in same Url pattern so that solution is deployed as Farm.
    Thanks 
    Gireesh Painuly

  • Adobe Drive 3 CMIS work with SharePoint 2013? (Getting errors)

    Hello guys.
    I'm trying to use Adobe Drive 3 with SharePoint 2013 to sync a folder by CMIS without success.
    I get a "Drive already mounted" message with an "Invalid location" error. Already tried using rest and soap url's, and on the SharePoint, the CMIS is
    enabled as well as the basic authentication (and the credentials are correct).
    Here's my Drive log (http://tny.cz/694b8841)
    I believe that this is a SharePoint problem maybe, but I don't know what to look at. Can someone help me on this?
    And also, is there anyone that have already did this? (Drive 3 + SharePoint 2013 CMIS).
    Thanks in advance,
    Matheus Barreto.

    Found it only work with Asset Libraries type of library on SharePoint, but even this way, on my Windows side I get a error about the drive the Adobe Drive create... My conclusion for now is that it does not work.

  • "Sharepoint 2013" is giving error that prevents local domain users authentication for "Team Foundation Server"

    I am getting 2 errors through the event viewer that prevents TFS 2013 authentication for local domain users, also this error started appearing after having TFS upgraded to [ 12.0.30723.0 (Tfs2013.Update3) ].
    1st Error (from administrative events):
    The Execute method of job definition Microsoft.SharePoint.Administration.SPUsageImportJobDefinition (ID a51a0244-765d-433b-8502-0bb0540ad1fd) threw an exception. More information is included below.
    Access to the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS' is denied.
    Tried so far:-
    - changed the path to another folder from "Diagnostic Logging" in another drive, but still getting the same error.
    2nd Error (from application server):
    DistributedCOM error
    The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 
    {000C101C-0000-0000-C000-000000000046}
     and APPID 
    {000C101C-0000-0000-C000-000000000046}
     to the user NT AUTHORITY\NETWORK SERVICE SID (S-1-5-20) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.
    Which I already got fixed using the following steps on a thread I opened before (but still getting the same error).
    https://social.technet.microsoft.com/Forums/windows/en-US/3896e35c-b99a-4d30-b662-f92d337c8d6f/windows-servers-components-services-and-regedit-permissions-are-grayed-out-for-my-admin-account?forum=winservergen
    Other Fixes I tried
    - Found on another topic that it is not sharepoint that is causing the problem, but it is the generated ASP.NET web pages used for testing is causing the memory to fill up due to cashing on RAM, the fix suggested to change IIS cashing from RAM to HD to prevent
    loading up using w3wp.exe from processes. 
    Concern
    - by checking other topics for people having the same problem, it was mentioned that this error appeared after the lastest TFS update, is there is a fix for it ?

    Hi Kpdn, 
    Thanks for your post.
    All your participation and support are very important to build such harmonious/ pleasant / learning environment for MSDN community.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • If statement formula in Sharepoint 2013 returns and error

    Hello
    I am trying to create an IF statement  and keep getting the following
    Technical Details
    Learn more about the syntax for formulas.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 6f86ad9c-2538-00bf-c686-c2b81c8e95eb
    Date and Time: 8/11/2014 6:00:02 PM
    I was told to create it in Excel then copy/paste into SP.  Here is the formula and it works perfectly in Excel:
    =IF(A11="H8K77AE - Face to face training ($750 USD/Day)","SAP",IF(A11="H8K78AE - Virtual Instructor Led training ($500 USD/Day)","SAP2",IF(A11="H8K79AE - Break/fix demos on lab equip WITH Instructor
    ($400 USD/Day)","SAP3",IF(A11="H8K80AE - Break/fix demos on lab equip WITHOUT Instructor ($200 USD/Day)","SAP4",IF(A11="H8K77A1 - Face to face training ($750 USD/Day)","Fusion",IF(A11="H8K78A1 - Virtual
    Instructor Led training ($500 USD/Day)","Fusion2",IF(A11="H8K79A1 - Break/fix demos on lab equip WITH Instructor ($400 USD/Day)","Fusion3",IF(A11="H8K80A1 - Break/fix demos on lab equip WITHOUT Instructor ($200 USD/Day)","Fusion4",""))))))))
    The only difference is I change the cell references of "A11", to the field name in SharePoint "[SKU#]".  when I hit OK I get the error above.  Does the field name not need to have the brackets around it or is it something
    different? 
    I am really hoping someone can help here as this should be rather simple and not sure why I don't get a result based on what is selected in the [SKU #] field
    Thank you for your assistance.
    Amathyst

    Try using the actual column name.

Maybe you are looking for

  • TS1398 My ipod has internet downstairs but when i go upstairs, i have no internet. Can someone help me?

    I have a router downstairs in my house. When i go downstairs, i have internet. But when i go back upstairs, i lose my internet and my ipod cant connect to the internet untill i go back downstairs. Can someone help me with this dalema?

  • MD5 identical for font files

    I put together a script that uses openssl sha1 <file> to check for duplicate files in a folder hierarchy. It gives the same hash result for all the members of a font family. Does that make sense as I would have thought there would be some differences

  • Updating OM infotype with blank values

    Hi All We have a custom field included in one of the standard infotypes using a CI include. When I try to update blank the values in the infotype using transaction PP01, I get the error 'A record without data cannot be saved'. the custom field is a c

  • Playlist ipod synch

    Since iTunes changed, I cannot synch my playlist to iPod shuffle.  I only listen to podcasts. No matter what I do, I can only play old podcasts that i thought I deleted.  The new podcasts just do not show up in my iPod, even though they appear in the

  • Extending R12 VO. Help very much appreciated

    Hi there, I am trying to extend a view object in oracle employee self service to add an additional Where clause to the query to only return data since '1-jan-11'. I have tried doing this using Jdeveloper however every time I try and create a new view