How to setup AD group to work with SharePoint group security

August 15, 2013 Leave a comment

Issue:

Recently, I am having issues with the permission setup at client side. The way we setup permission is we create AD Group and add the add AD Group to the proper SharePoint Group. If we need to grant permission to a user, we then add the user to the correct AD group. But end user reports that by adding a user to an AD group, this user does not have any access to the SharePoint site.

Solution:

Change the AD Group scope from Global to Universal fix the problem.

From


To


References:

AD Group Scopes from Paul Stork

http://social.technet.microsoft.com/forums/en-US/sharepointadminprevious/thread/79d2af40-3daa-4f61-86e5-5bb54086147f

This task is currently locked by a running workflow and cannot be edited. Limitation to both Nintex and SPD workflow

August 15, 2013 Leave a comment

Note, this post is from Nintex Forum here. These limitations apply to both SharePoint designer Workflow and Nintex Workflow as Nintex using the SharePoint workflow engine.

The common cause that I experience is that ‘parent’ workflow is generating more than one task at once. This is common as you can have multiple approvers for certain approval process. You could also have workflow running when the task is created, one of the common scenario is you would like to set a custom column value in your approval task. For me this is huge limitation, as Nintex lover I really hope Nintex could solve this problem with Microsoft going forward.

Introduction

“This task is currently locked by a running workflow and cannot be edited” is a common message that is seen when an error occurs while the SharePoint workflow engine is processing a task item associated with a workflow.

When a workflow processes a task normally, the following sequence of events is expected to occur:

1.       The process begins.

2.       The workflow places a ‘lock’ on the task so nothing else can change the values while the workflow is processing.

3.       The workflow processes the task.

4.       The lock is released when the task processing is finished.

When the message is encountered, it usually indicates that an error occurred between step 2 and 4. As a result, the lock is never released.

Therefore, the ‘task locked’ message is not an error itself, rather a symptom of another error – the ‘task locked’ message does not indicate what went wrong. In most cases, once this message is encountered, the workflow cannot be made to continue and must be terminated and started again.

The following is a guide that can help troubleshoot the cause of these messages.  Some initial observations to narrow down the potential causes are:

Is the error consistent or intermittent?

When the error is consistent, it will happen every time the workflow is run. When it is intermittent, it may happen regularly, but not every time.

Does the error occur the first time the user tries to respond to a task, or do they respond and notice the workflow does not continue, and when they respond again the error occurs?

If the message is present when the user first responds to the task, the issue would have occurred when the task was created. Otherwise, it would have occurred when the user attempted to respond to the task.

Causes

Modifying the task list

A cause of this error appearing consistently the first time a user tries to respond to a task is a modification to the default task list schema. For example, changing the ‘Assigned to’ field in a task list to be a multiple selection will cause the behaviour.

Deleting the workflow task then restoring it from the Recycle bin

If you start a workflow, delete the workflow task then restore it from the Recycle Bin in SharePoint, the workflow will fail with the ‘task locked’ error.  This is confirmed behaviour whether using a SharePoint Designer or a Nintex workflow.  You will need to terminate the workflow and start it again.

Parallel simultaneous responses

A cause of this error appearing inconsistently is multiple users responding to tasks in parallel at the same time. In this scenario, one task will complete correctly and the other will not process. When the user tries again, the ‘task locked’ message will display. Nintex included a workaround for this issue in build 11000. In build 11000 and later, one of the users will receive a message on the task form when they attempt to respond, stating that they need to try again in a few moments.

Additional processing on the task

A cause of this error appearing consistently and inconsistently is having an additional system running on the items in the task list. Some examples include: a workflow running on the task list, an event receiver running on the task list or another automated process querying and updating workflow tasks.

Note: This Microsoft help article (http://office.microsoft.com/en-us/sharepointdesigner/HA102376561033.aspx#5) explains creating a workflow that runs on the task list to update a field on the task. Our experience shows that this causes the ‘Task Locked’ issues when the ‘parent’ workflow is generating more than one task at once.

Isolated system error

If the error is a rare event, or a ‘one off’ event, then an isolated system error may have occurred.

For example, if there is a database connectivity issue while the workflow is processing the task response, the task will lock. In this case, the user will respond to a task but the workflow will not continue. When they respond again, the ‘task locked’ message will display. In this case, there will be an error in the SharePoint ULS Logs at the time that the user originally responded.

Temporary delay while workflow processes

If the workflow is taking a long time to process after a user submits a task, they may notice and try to respond to the task again. They will see the task locked error, but after a number of attempts (or after waiting some time) the task response page eventually indicates the task has been responded to. In this case, nothing actually went wrong, and the error message gives an accurate indication of what is happening – the workflow temporarily locked the task while it was processing. This scenario may occur in a very large workflow, or after the SharePoint application pool has just started.

Modifying the task via a web service with an invalid url

If the Nintex Workflow web service is used to respond to or delegate a task, the site context part of the url must be a valid alternative access mapping url. For example, if you access the web service via the IP address of the SharePoint server, and the IP address is not a valid AAM, the task can become locked.

The workflow has become stuck without any apparent errors

This behaviour can occur as a result of a bug in the SharePoint 2010 workflow engine.  If you do not have the August 2010 Cumulative Update (or later) for SharePoint, and your workflow uses delays, “Flexi-task”, State machine”, “Task Reminder” actions or variables, you could be affected. Check the SharePoint 2010 Updates site here: http://technet.microsoft.com/en-us/sharepoint/ff800847.  The October CU is recommended http://support.microsoft.com/kb/2553031.   The fix is described as “Consider the following scenario. You add a Delay activity to a workflow. Then, you set the duration for the Delay activity. You deploy the workflow in SharePoint Foundation 2010. In this scenario, the workflow is not resumed after the duration of the Delay activity”.

If you find this is occurring in your environment, install the October CU, terminate all the running workflows affected and run them afresh.

Investigative steps

The first step to isolate the issue is to create a new task list on the site and configure the workflow to use it.  Any customizations that were made to the original task list should not be made to the new task list. If the new task list eliminates the issue, then the cause can be attributed to the original task list or a change that was made to it.

To change the task list that the workflow uses:

In Workflow Designer select Settings -> Startup Options


Then configure the task list as required


If any of the scenarios above do not help, check the SharePoint logs for any messages with a category of ‘Workflow Infrastructure’.

Conclusion

The information in this article has been gathered from observations and investigations by Nintex. The sources of these issues are the underlying SharePoint workflow engine. This article will be updated if further causes are discovered.

From <http://connect.nintex.com/forums/thread/6503.aspx>

How to create Office365 SharePoint site using SharePoint2010 template

July 15, 2013 Leave a comment

Recently, I worked with a client that has office 365 upgraded to SharePoint 2013.But they still like to create the SharePoint site using the old SharePoint2010 template, if you like to know how , here are the steps:

1. Go to your Office 365 portal https://portal.microsoftonline.com/admin/default.aspx and then go to the SharePoint admin page.

2. Next, click settings page.

3. Change the Global experience Version Settings.

4. Finally, you will be able to create SharePoint site using 2010 template.

How to copy items using Nintex Workflow

June 11, 2013 1 comment

Nintex does not offer copying items from one SharePoint library to another out of box. However, it is not hard to implement one yourself. You can use the copy.asmx web services to achieve this. Here are the steps below and you can download the source here

1. Create a UDA with the following parameters:

2. Call the copy.asmx service to copy the item from SouceItemUrl to DestinationItemUrl

3. If your destination document library has versioning and check-in/out turned on , you can use list.asmx to check in your file as below:

4. You need to create constant of Credential type named SP_WORKFLOW_WS as below

5. Here is how it looks like in the Workflow designer.

6. To call this UDA, you can perform the following in your workflow

How to write PowerShell code part 4 (using loop)

May 31, 2013 Leave a comment

In this post, I’d like to show you how to loop through the xml element. I will use the list data deletion script as an example. You can download the script here.

1. To perform the loop, I use foreach in powershell. Here is my xml looks like


<?xml version="1.0" encoding="utf-8"?>
<Site Url="http://workflowuat/npdmoc">
 <Lists>
 <List Name="YBBEST Collaboration Areas" Type="Document Library"/>
 <List Name="YBBEST Project" />
 <List Name="YBBEST Document"/>
 </Lists>
</Site>

2. Here is the PowerShell to manipulate the xml. Note, you need to get to the $configurationXml.Site.Lists.List variable rather than $configurationXml.Site.Lists


foreach ($list in $configurationXml.Site.Lists.List){
 AppendLog "Clearing data for $($list.Name) at site $weburl" Yellow
 if($list.Type -eq "Document Library"){
 deleteItemsFromDocumentLibrary -Url $weburl -ListName $list.Name
 }else{
 deleteItemsFromList -Url $weburl -ListName $list.Name
 }
 AppendLog "Data in $($list.Name) at $weburl is cleared" Green
}

How to write PowerShell code part 1
How to write PowerShell code part 2
How to write PowerShell code part 3
How to write PowerShell code part 4

How to display workflow related tasks in the item display page where the workflow is currently running on in SharePoint2013

May 30, 2013 1 comment

In one of the project, I need to display workflow related tasks in the item display page where the workflow is currently running on. To achieve this, I’d like to add the tasks list view web part and using the connected web part to achieve this.(ID=workflowitemid)

However, to make it work I need to unhide the workflowitemid field in the task list, as it is hidden field and also cantogglehidden field is set to false. I need to use reflection to change the cantogglehidden field to true as it only has getter in the API and then I am able to unhide the field. You can download the script here. However, it is not ideal (make your environment not supported by Microsoft) to display tasks this way.

Another way to display the related task is to use SharePoint designer solution with List view web part and data source. Here are the steps.

1. Create a new list display form as below

2. Edit the custom display form in advanced mode.

3. Find the PlaceHolderMain contentplace hoder and insert the DataView by choosing the associated workflow tasks list as below

4. Go to the List View Tools >> OPTIONS

5. Create a Parameter called workflowitemId Parameter which retrieve the value from the ID querystring as below

6. Create a filter based on UIVersion = workflowitemId as below ,we are going to change the UIVersion to WorkflowItemId property later as WorkflowItemId is a hidden field and cannot be selected from the wizard.

7. Replace UIVersion with WorkflowItemId in the caml for the XsltListViewWebPart.

From:

TO

8. Go to the new custom display page at http://yourserver/Lists/aa/CustomDisplayPage.aspx?ID=414, you will see the associated tasks are showing in the page.

References:

http://office.microsoft.com/en-us/sharepoint-designer-help/watch-this-design-a-document-review-workflow-solution-HA010256417.aspx (Video 12 and 13)

Truly understand the threshold for document set in document library in SharePoint

January 27, 2013 Leave a comment

Recently, I am working on an issue with threshold. The problem is that when the user navigates to a view of the document library, it displays the error message “list view threshold is exceeded”. However, in the view, it has no data. The list view threshold limit is 5000 by default for the non-admin user. This limit is not the number of items returned by your query; it is the total number of items the database needs to read to calculate the returned result set. So although the view does not return any result but to calculate the result (no data to show), it needs to access more than 5000 items in the database. To fix the issue, you need to create an index for the column that you use in the filter for the view. Let’s look at the problem in details. You can download a solution to replicate this issue here.

1. Go to Central Admin ==> Web Application Management ==>General Settings==> Click on Resource Throttling

2. Change the list view threshold in web application from 5000 to 2000 so that I can show the problem without loading more than 5000 items into the list.

FROM

TO

3. Go to the page that displays the approved view of the Loan application document set. It displays the message as shown below although I do not have any data returned for this view.

4. To get around this, you need to create an index column. Go to list settings and click on the Index columns.

012613_2210_Trulyunders5.png

5. Click on the “Create a new index” link.

012613_2210_Trulyunders6.png

6. Select the LoanStatus field as I use this filed as the filter to create the view.

012613_2210_Trulyunders7.png

7. After the index is created now I can access the approved view, as you can see it does not return any data.

012613_2210_Trulyunders8.png

Notes:

List View Threshold: Specify the maximum number of items that a database operation can involve at one time. Operations that exceed this limit are prohibited.

References:

SharePoint lists V: Techniques for managing large lists

Manage large SharePoint lists for better performance

http://blogs.technet.com/b/speschka/archive/2009/10/27/working-with-large-lists-in-sharepoint-2010-list-throttling.aspx

Follow

Get every new post delivered to your Inbox.

Join 155 other followers