Tag: Nintex

Reusing Css styles in Nintex Workflow notification emails

Workflows can have a lot of notifications and customizing and reformatting them individually can take a bit of time, perhaps a better way would be to apply css styles somewhere in a single css file and reuse it through out.

Nintex Workflow uses a css file containing default styles which it embeds within emails. We can easily create a copy it with our custom styles and this way we can avoid changing css for every single notification and also if we want to apply a simple change to all notification emails, it can be simply be applied to this single file.

To do this, let’s first download the default css file. Please go to Central Administration, Nintex Workflow Management and then Global Settings, you will see a link to css file

Paste this url in the browser to download this css, it would be something like http://SharePointServer:Port/_layouts/15/NintexWorkflow/HtmlEditorStyles.css

Let’s rename this file to avoid overwriting the default and edit it.

Now to publish changes upload the new file to anywhere in layouts folder, change the link above and save it.

There a quite a few style rules in this css, Be mindful of the comments above which states that each style rule must be followed by a { on the next line and end with a } on its own line for the parser to function correctly

All have the styles have some meta data information embedded with “–ms-” prefix and this is how email editor maps styles. For example at the top there are styles for colors with –ms-color prefix and some colors, if we take the first one, -ms-color says “Dark Red” and now we see it in email editor there is a Dark Red color as well, now we change color attribute value here we can use this in the editor, we can even change names so it is easier to find.

.ntx-rteForeColor-1
{
  color: darkred;
  -ms-name: "";
  -ms-color:"Dark Red";
}

Likewise there are styles for Fonts, Headings and others. To change default font and styles in body, we can make changes in following rule

.ntx-rte-messageBody
{
  font-family: Calibri, Verdana, Arial, Sans-Serif;
  font-size: 11pt;
  color: Black;
}

One of the most frequently used one would be changing styles for tables. Default styles are listed in design tab in ribbon upon selecting a table and we can customize one these styles.

In the CSS file these styles are named with –ms-name attribute, try searching for “Table Style 2 – Medium” and then you can which style is being used. Following are rules being applied to this table design

.ntx-rteTable-1
{
  -ms-name:"Table Style 2 - Medium";
  border-width: 0px;
  border-style: none;
  border-collapse: collapse;
  font-family: Tahoma;
}

.ntx-rteTable-1 tr.ntx-rteTableHeaderRow-1
{
  margin: 10px;
  padding: 10px;
  color: #3F4D6B;
  background: #D6E8FF;
  text-align: left;
  font-size: 10pt;
  font-style: normal;
  font-family: Tahoma;
  text-transform: capitalize;
  font-weight: bold;
  border-spacing: 10px;
  line-height: 14pt;
  vertical-align: top;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderLastCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderOddCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
  color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 td.ntx-rteTableHeaderEvenCol-1
{
  padding:0in 5.4pt 0in 5.4pt; color: #3a4663;
  line-height: 14pt;
}

.ntx-rteTable-1 tr.ntx-rteTableOddRow-1
{
  color: #666666;
  background-color: #F2F3F4;
  font-size: 10pt;
  vertical-align: top;
}

.ntx-rteTable-1 tr.ntx-rteTableEvenRow-1
{
  color: #666666;
  background-color: #E7EBF7;
  font-size: 10pt;
  vertical-align: top;
}

.ntx-rteTable-1 td.ntx-rteTableFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableLastCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableOddCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 td.ntx-rteTableEvenCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
}

.ntx-rteTable-1 tr.ntx-rteTableFooterRow-1
{
  background-color: #D6E8FF;
  color: #4A5A80;
  font-weight: 500;
  font-size: 10pt;
  font-family: Tahoma;
  line-height: 11pt;
}

.ntx-rteTable-1 td.ntx-rteTableFooterFirstCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  border-top: solid gray 1.0pt;
  text-align: left;
}

.ntx-rteTable-1 td.ntx-rteTableFooterLastCol-1
{
  padding:0in 5.4pt 0in 5.4pt;
  border-top:solid gray 1.0pt;
  text-align:left;
}

.ntx-rteTable-1 td.ntx-rteTableFooterOddCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  text-align: left;
  border-top: solid gray 1.0pt;
}

.ntx-rteTable-1 td.ntx-rteTableFooterEvenCol-1
{
  padding: 0in 5.4pt 0in 5.4pt;
  text-align: left;
  border-top: solid gray 1.0pt;
}

I hope you find this post useful, thanks.

Advertisements

Nintex Workflow 2010 – The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

While trying to set field value or update list item action after set item permissions for setting workflow initiator’s permission to read only so that he or she could not modify the list item I was getting the following error in email.

The workflow could not update the item, possibly because one or more columns for the item require a different type of information.

On the workflow status page in the history list an event was logged with Error event type and outcome of that event was access denied.

After exploring a little bit I found out that this error was coming because Nintex workflow runs in the user context of initiator so if the initiator doesn’t have permission to modify list items set field value and update list items actions would fail.

There is a way to run the workflow in the context of user who publishes it. Thia option can be enabled by editing an action, go to common settings and then enable “Run as workflow owner”. This option is not available in all actions so to use it in actions where it is not available please drop an action set action in the workflow, enable this setting and then drop the actions you want to use, in my case I was using state machine workflow and then was using set field value.

image

I hope you find this post useful. Thanks for reading.

How to approve or reject SharePoint workflow using Nintex workflow

To approve or reject a SharePoint Workflow from a Nintex Workflow is very easy. There is a web service exposed from SharePoint which is Workflow.asmx, you can access it at

http:// server /_vti_bin/workflow.asmx

Now the method that we will be using to action our SharePoint workflow is AlterToDo. This method takes the following arguments:

  • Item (The URL location of an item on which a workflow is being run)
  • todoId (Unique identifier of the assigned task)
  • todoListId (Globally unique identifier (GUID) of the assigned task list containing the task)
  • taskData (Task data for conversion into a hash table)

Okay so back to Nintex now.

Step 1: Add a call web service workflow action and configure it.

Step 3: Add URL of workflow.asmx web service in the URL field, specify username and password and click refresh to update list of available methods in the Web Service

Step 3: Select SOAP Editor in editor mode, this is necessary as you will be adding some xml in TaskData parameter and select SOAP builder mode seems to html encode < > signs which results in error

Step 4: Specify item, todoId, todoListId and paste the following xml in tag.

<my:myFields xmlns:my=”http://schemas.microsoft.com/office/infopath/2003/myXSD&#8221; >

<my:TaskStatus>Approved</my:TaskStatus>

<my:Status>Completed</my:Status>

<my:PercentComplete>1.00000000000000</my:PercentComplete>

<my:Completed>1</my:Completed>

</my:myFields>

Your configuration should look something like this

Calling Workflow.asmx using Nintex workflows

Try some fixed values first for testing purposes and click run and then replace them.

I hope you find this post useful. Thanks for reading.

3 reasons to choose Nintex as a Workflow Solution for SharePoint

I’ve used Nintex in a few projects both for SharePoint 2007 and 2010. My experience has been very good and I usually recommend it to medium sized organizations. Why I think Nintex is good solution, following are top three reasons.

  1. Creating a workflow is as easy as visualizing one, check out the two-minute overview
  2. Rich documentation and support, check out Nintex Connect
  3. Great return on investment, see what their customers are saying.

 

Approve or reject workflows via email using Nintex with SharePoint 2010 or 2007

Usually top executives in a company use emails heavily for communication and automating business process requires approval from such executives. To ease their lives one good solution is to give them the flexibility of approving workflows via email so whether their using Outlook, Blackberry or iPhone, they can see the necessary details in the email body and simply reply with “approve” or “reject” to action items rather than clicking a link in email, going to SharePoint portal and then click some button.

This feature is called LazyApproval in Nintex. To configure this follow these steps