Archive

Archive for the ‘SharePoint 2010’ Category

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

How to create a link to Nintex Start Workflow Page in the document set home page

January 19, 2013 1 comment

In this blog post, I’d like to show you how to create a link to start Nintex Workflow Page in the document set home page.

1. Firstly, you need to upload the latest version of jQuery to the style library of your team site.


2. Then, upload a text file to the style library for writing your own html and JavaScript

3. In the document set home page, insert a new content editor web part and link the text file you just upload.

4. Update the text file with the following content, you can download this file here.

<script type="text/javascript" src="/Style%20Library/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="/_layouts/sp.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    listItemId=getParameterByName("ID");
	setTheWorkflowLink("YBBESTDocumentLibrary");
});
function buildWorkflowLink(webRelativeUrl,listId,itemId) 
{ 	
	var workflowLink =webRelativeUrl+"_layouts/NintexWorkflow/StartWorkflow.aspx?list="+listId+"&ID="+itemId+"&WorkflowName=Start Approval";
	return workflowLink;
}
function getParameterByName(name)
{
	name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
	var regexS = "[\\?&]" + name + "=([^&#]*)";
	var regex = new RegExp(regexS);
	var results = regex.exec(window.location.search);
	if(results == null){
		return "";
	}
	else{
		return decodeURIComponent(results[1].replace(/\+/g, " "));
	}
}

function setTheWorkflowLink(listName) 
{ 	
	var SPContext = new SP.ClientContext.get_current(); 
	web = SPContext.get_web(); 
	list = web.get_lists().getByTitle(listName); 
	SPContext.load(web,"ServerRelativeUrl"); 
	SPContext.load(list, 'Title', 'Id');	
	SPContext.executeQueryAsync(setTheWorkflowLink_Success, setTheWorkflowLink_Fail); 
}
function setTheWorkflowLink_Success(sender, args) 
{ 
	var listId = list.get_id(); 
	var listTitle = list.get_title(); 
	var webRelativeUrl = web.get_serverRelativeUrl();
	var startWorkflowLink=buildWorkflowLink(webRelativeUrl,listId,listItemId)
	$("a#submitLink").attr('href',startWorkflowLink);
}
function setTheWorkflowLink_Fail(sender, args) 
{
	alert("There is a problem setting up the submit exam approval link");
}
</script>
<a href="" target="_blank" id="submitLink"><span style="font-size:14pt">Start the approval process.</span></a> 

5. Save your changes and go to the document set Item, you will see the link is on the home page now.

Notes:

1. You can create a link to start the workflow using the following build dynamic string configuration:

{Common:WebUrl}/_layouts/NintexWorkflow/StartWorkflow.aspx?list={Common:ListID}&ID={ItemProperty:ID}&WorkflowName=workflowname.
With this link you will still need to click the start button, this is standard SharePoint behaviour and cannot be altered.

References:

http://connect.nintex.com/forums/27143/ShowThread.aspx

How to use html and JavaScript in Content Editor web part in SharePoint2010

Nintex workflow tips and tricks

January 18, 2013 Leave a comment

Here are some Nintex 2010 workflow related tips and tricks and I will keep updating them.

1. How to add a link in email using Nintex.

a. Go to the insert tab and select Link


b. Select the url you’d like to set for the link


c. After you have done this , you will see the Link is inserted into the email.

2. How to make the Flexi task reject option called “Decline” and make the comments mandatory.

a. Open the  Flexi task action config prompt as shown below

FlexitaskReconfigure1

b.Click on the edit icon and change the settings from

FlexitaskReconfigure2

TO

FlexitaskReconfigure3

3. When saving or publishing Nintex workflow and receiving the following errors:

Server was unable to process request. —> The file hxtp://../NintexWorkflows/Workflowname/Workflowname.xoml is checked out for editing by Domain/Username.

To Fix it , you can perform the following steps:

a.In the publish dialogue, uncheck “Overwrite existing version” and rename the workflow.
b.Delete the old workflow which was checked out
c.Publish the new workflow again with the old name
d.Delete the “temporary” workflow again

How to use the client object model with SharePoint2010

January 17, 2013 Leave a comment

In SharePoint2010, you can use client object model to communicate with SharePoint server. Today, I’d like to show you how to achieve this by using the c# console application. You can download the solution here.

1. Create a Console application in visual studio and add the following references to the project.


2. Insert your code as below

            ClientContext context = new ClientContext("http://demo2010a");
            Web currentWeb = context.Web;
            context.Load(currentWeb, web =&gt; web.Title);
            context.ExecuteQuery();
            Console.WriteLine(currentWeb.Title);
            Console.ReadLine();

3. Run your code then you will get the web title displayed as shown below

Note:

If you got the following errors, you need to change your target framework from .Net Framework 4 client profile to .Net Framework 4 as shown below:

Change from

TO

How to use Nintex Reusable Workflow Template

January 17, 2013 Leave a comment

If you like to re-use your workflow logic over more than one list or library, you can create reusable workflow template. Here are the steps

1. Go to site settings and create reusable workflow template.

2. Select the content type you like the template to bound to and give a workflow a title.

3.Create your workflow the same way as you did for a list workflow and publish your workfow.


4. Finally, you need add your workflow to the list you like to run your workflow.

5. Go to workflow settings and add a Workflow.

6. Select the content type and configure the workflow as below


7. After you done this, your workflow will run as usual.

Note:

1. You cannot conditionally start your workflow.

2. Your workflow is not automatically bound to the list when you add the content type to the list, you need to configure it manually as shown in step 4-6.

How to use html and JavaScript in Content Editor web part in SharePoint2010

January 15, 2013 1 comment

Here are the steps you need to take to use html and JavaScript in content editor web part.

1. Edit a site page and add a content editor web part on the page.


2. After the content editor is added to the page, it will display on the page like shown below


3. Next, upload your html and JavaScript content as a text file to a document library inside your SharePoint site.

Here is the content in the document

<script type="text/javascript">
alert("Hello World");
</script>

4. Edit the content editor web part and reference the file you just uploaded.


5. Save the page and you will see the hello world prompt.

References:

http://stackoverflow.com/questions/5020573/sharepoint-2010-content-editor-web-part-duplicating-entries

http://sharepointadam.com/2010/08/31/insert-javascript-into-a-content-editor-web-part-cewp/

How to create multiple lines Text field that can take more than 255 characters in SharePoint2010

January 14, 2013 1 comment

If you ever find the multiline textbox reach the limit of 255 characters, here is you need to do to remove the limit. You need to go to the site settings and then go to the site columns. Next, you need to go to the column setting page and change Allow unlimited length in document libraries from NO to Yes as shown below:

FROM

TO

How to Use User-defined function using Nintex workflow

January 13, 2013 Leave a comment

In Nintex workflow, you can create re-usable workflow logic by creating user defined function. The user-defined function is very similar to a method defined using c# or java. You can have input parameter and output-parameter. You then call the user defined function by passing in the parameter and return the output parameter. Here are the steps:

1. Create your user defined action

2. Define your output and input parameters


3. Create your workflow logic as normal and publish your user defined action.

4. You can call the user defined action from your main workflow.

Note:

1. One of the limitation for the user defined action is that you cannot create Person or Group variable.

How to combine several files into one PDF using Nintex and Muhimbi PDF Converter

December 24, 2012 Leave a comment

Recently I am using Nintex workflow and Muhimbi to build a solution for a client. One of the requirement is to combine several files within the document set into one , this is really simple to do with Muhibmi PDF Converter and Nintex.

1. You need to activate the Muhimbi PDF Converter – Nintex Workflow Integration feature at the Web Application level.

2. Then, we need to retrieve the sever relative URL path for the document set as shown below.(You can use URL Path or Server Relative url property when you query the list)

3. Then, we need to build the combined PDF path.

4. Next, we need to build the paths for all documents we need to combine.

5. Finally, we need to perform the conversion using the Muhimbi Nintex action below


You can download the Nintex Workflow here.

*****************Update 07/01/2013****************

@muhimbi PDF converter Merge files to PDF action does not work inside a IF or LOOP action when used in @Nintex workflow.Have to change all my @Nintex IF action to Set A CONDITION action to make @muhimbi PDF converter Merge files to PDF action works.I also checked with Muhimbi PDF converter support ,I was told that upgrade to the latest version of the product will solve the problem , I have not tried yet and will update here once I have tried it.

The error I am getting is An error has occurred in [Workflow Name].

*****************Update 13/01/2013****************

Another problem I am having is to invoke the workflow using the document set item rather than a document inside the document set.You will get the error message “An error has occurred in [Workflow Name]“. To resolve the problem you need to configure the Source List and Source List Item properties for the conversion as shown below.

CombinedPDFGeneration

References:

Convert and Merge PDFs using Nintex Workflow and the PDF Converter for SharePoint

What is new in SharePoint2013 Workflow

December 22, 2012 Leave a comment

In SharePoint 2013, Microsoft provides a new way for creating workflows while the existing SharePoint 2010 Workflow platform has been carried forward to SharePoint 2013. SharePoint 2013 workflows are powered by Windows Workflow Foundation 4, which was substantially redesigned from earlier versions. These changes bring a major advancement to workflow and make SharePoint workflows to handle much more complex scenarios.

Let’s first look at the high-level architecture of the workflow infrastructure. As you can see from the SharePoint2013 Architecture diagram below, SharePoint 2010 workflow execution was hosted in SharePoint itself, this has been retained in SharePoint 2013 to allow for backward compatibility while Windows Azure Workflow is external to SharePoint and communicates using common protocols over the Windows Azure service bus, mediated by OAuth. Windows Azure Workflow also can be installed on a separate server. This new workflow infrastructure combined with Windows Workflow Foundation 4 provides SharePoint2013 workflow with more capabilities, such as Service Bus messaging, elastic scalability, and managed service reliability.

                

SharePoint2013 Architecture

Next, let’s look at what is new in SharePoint 2013 workflow and how these changes will make it more appealing than SharePoint 2010 workflow.

1. Declarative authoring in both SharePoint Designer and Visual Studio

Workflow authoring is declarative only in SharePoint2013 Workflow. It simplified the way workflows are created and also provides a consistent experience for creating workflow in SharePoint designer and Visual Studio. Workflows are no longer compiled into managed assemblies and deployed to an assembly cache. Instead, XAML files define your workflows and frame their execution. You can see screenshot below on how you create the same workflow in Visual Studio and SharePoint Designer.

SPD Declarative workflow Authoring

Visual Studio Declarative workflow Authoring

Another great feature inside SharePoint Designer is called visual designer for workflow. This feature is enabled when you have installed Visio 2013. It provides a new way to design workflow alongside the traditional text-based workflow designer as shown below.


                

SPD Visual Designer view

2.Workflow stages to tackle more complex workflow scenarios

This is the major improvement made by Microsoft in SharePoint 2013 workflow as it allows you to create declarative state machine workflow using SharePoint. In SharePoint 2010, you can only create sequential workflow using SharePoint Designer. If you like to create state-machine workflow, you need to get a developer involved as it can only be created inside Visual Studio. Sequential workflow can only handle simple workflow as it executes in a predefined order, on the other hand, state machine workflow can model more complex workflow as it is event driven. Depending on different state, certain actions will take place.

3. New workflow actions and data type to enhance workflow capability

SharePoint 2013 adds several new SharePoint actions to extend the workflow capability. I will highlight some of the significant ones and for a complete list of the actions in SharePoint2013, you can check the MSDN.

  1. Call HTTP web service: This action enable no-code web service calls from inside a workflow. Organisation can utilize this action to have a better management of integrating external processing with workflow. As business analyst can model the actual business process inside workflow while developer can expose the external processing logic via web services.
  2. Loop: The ability to loop through a collection is missing in SharePoint2010 and having this capability will align SharePoint processing logic with what is expected from a workflow engine.
  3. Dynamic value / Dictionary type: These terms refer to the same data type, dynamic value is used in Visual Studio while dictionary type is used in SharePoint Designer. This new data type used in conjunction with HTTP web service request make it much easier to consume web services from within the workflow.
  4. Start SharePoint2010 workflow.
    There is full interoperability in SharePoint 2013 with SharePoint 2010 workflows, which is enabled by using the Workflow interop bridge.

4. Cloud ready

There is 100 percent parity in SharePoint 2013 between on-premises and Office 365 -based workflows as shown in the picture below; therefore you can easily move an on-premises workflow to the cloud. Office 365 has already got the Windows Azure Workflow installed and configured properly. You do not have to do anything if you’d like to take advantage of the new workflow capability in the Office 365.


                Office365 Architecture

As you can see, Microsoft made a big investment in SharePoint2013 workflow and these changes make the SharePoint2013 workflow more robust, easier to build and provide more capabilities to help you to streamline your business processes. We are looking forward to helping your business take advantage of these new capabilities.

References:

http://technet.microsoft.com/en-us/library/jj219638%28v=office.15%29.aspx

http://msdn.microsoft.com/en-us/library/jj163181%28v=office.15%29.aspx

http://geekswithblogs.net/KunaalKapoor/archive/2012/08/14/sharepoint-2013-ndash-workflows.aspx

http://msdn.microsoft.com/en-us/library/jj163177%28v=office.15%29.aspx

http://msdn.microsoft.com/en-us/library/jj163091%28v=office.15%29.aspx

http://msdn.microsoft.com/en-us/library/jj163181(v=office.15).aspx

http://msdn.microsoft.com/en-us/library/jj163272(v=office.15).aspx

http://www.sharepointpromag.com/article/sharepoint/sharepoint-2013-features-144003

http://weblogs.asp.net/scottgu/archive/2012/07/26/windows-azure-and-office-365.aspx

http://www.andrewconnell.com/blog/archive/2012/07.aspx

Follow

Get every new post delivered to your Inbox.

Join 143 other followers