Month: September 2012

Write to workflow history list state machine workflow sharepoint 2010 C# code

void WriteToHistoryList(string comment, string outcome)
        {
            SPWorkflow.CreateHistoryEvent(workflowProperties.Web, this.WorkflowInstanceId, 0, workflowProperties.Web.CurrentUser, new TimeSpan(), outcome, comment, “”);
        }
Advertisements

Make Column Read Only Sharepoint 2010

PS C:\Users\gadekasa> $spWeb = Get-SPWeb http://abc:5552/sites/AirCraft/
PS C:\Users\gadekasa> $spList = $spWeb.Lists[“AllWorkflowDefaultList”]
PS C:\Users\gadekasa> $fields =$spList.Fields[“Role”]
PS C:\Users\gadekasa> $fields.ReadOnlyField = $false
PS C:\Users\gadekasa> $fields.update($true)
PS C:\Users\gadekasa> $spList.Update()
PS C:\Users\gadekasa> $spWeb.Dispose()