Tag Archives: sharepoint

SharePoint Event Receiver Does Not Fire

1. Add Trace Log to see if it is really not firing: string now = DateTime.Now.ToString(“ddMMyyyy-HHmmss”); // Creates the text file that the trace listener will write to. System.IO.FileStream myTraceLog = new System.IO.FileStream(“C:\\temp\\SharePoint Trace Log\\” + now + “.txt”, System.IO.FileMode.OpenOrCreate); … Continue reading

Posted in Event Receiver, SharePoint 2010, Visual Studio 2010 | Tagged , , | Leave a comment

Programmatically complete a workflow task

To complete a workflow task programmatically, use the following code (say taskItem is the task you want to complete): taskItem.Web.AllowUnsafeUpdates = true; Hashtable data = new Hashtable(); data[SPBuiltInFieldId.Completed] = “TRUE”; data[SPBuiltInFieldId.PercentComplete] = 1; data[SPBuiltInFieldId.Outcome] = “Completed”; data[SPBuiltInFieldId.TaskStatus] = SPResource.GetString(new CultureInfo((int)taskItem.Web.Language, … Continue reading

Posted in SharePoint 2010, Visual Studio 2010 | Tagged , | Leave a comment

Get current item ID or other field value in an infopath form

Tools >> Data Connections >> Add >> Create a new connection to: Receive Data >> Select SharePoint library or list >> enter the url of the form library (the same address that you published the form to. Then Select the … Continue reading

Posted in InfoPath 2010, SharePoint 2010 | Tagged , | Leave a comment

“An entry with the same key already exists” Error

Check if there are duplicated values in a drop down list If you are trying to set more than one option in a drop down list as selected, i.e., item.Selected = true; , you will get this error.

Posted in SharePoint 2010, Visual Studio 2010 | Tagged , | Leave a comment

SharePoint Designer workflows not to update on the SharePoint site

For SharePoint Designer, the solution is similar to Dave’s solution. It seems SharePoint Designer saves local copies of DLLs from your servers, and although everything seems OK, this prevents it from updating the workflow (this is when custom activities are … Continue reading

Posted in SharePoint Designer 2010 | Tagged , | Leave a comment

Customize “Start Custom Task Process” in SharePoint Designer 2010

This is how you can use “Start Custom Task Process” to get the same result from “Collect data from a user”: 1. Create a Workflow in SharePoint Designer 2010 (SPD2010) and add the following actions: Click on “Task (2)” to … Continue reading

Posted in InfoPath 2010, SharePoint 2010, SharePoint Designer 2010 | Tagged , , | 1 Comment

Link an Excel workbook to a SharePoint list

http://www.youtube.com/watch?v=weyli9OGJhk You can export a SharePoint list to an Excel workbook and do data analysis on Excel. When data in SharePoint list is changed, it will change the Excel workbook as well, so you will always have an up-to-date Excel … Continue reading

Posted in Excel, Microsoft Office, SharePoint 2010 | Tagged , | Leave a comment