Friday, May 25, 2012

How do I email the "originator" of a workflow?

Many customers want to include the originator of a workflow as a participant in the process.  Maybe they want to email the originator that an approval process was started on a record they saved, or perhaps that a change they made was rejected.

The SharePoint Designer workflow builder can identify the creator/updator of a SharePoint list item and use that information for the purpose of emailing the originator of the workflow.  However, with U-LINC, the workflow originator is the user account that the U-LINC Web Services has assigned.  As such, if this is an account like integrity\ulinc, the originator will not be the intended workflow participant.

The solution ...

When a user creates a U-LINC integration, the system automatically includes a "SQL User" column in the target list. This column will be populated with the user ID that made the connection to SQL Server.   If your application that is storing data in SQL is using Windows authentication, this will be populated with the Windows user ID.  You can therefore use the "SQL User" column to identify the workflow originator.

However, In the case of Dynamics GP, this will be the backoffice user ID because Dynamics GP uses SQL authentication to make the connection to SQL.  SharePoint workflow cannot email Dynamics GP user 'THOMAS', so, how do we include the true originator as a participant in the workflow for U-LINC enabled workflows?  Unfortunately, there is no one-size-fits-all answer.  The most common implementation is to create a SharePoint list ("User") that contains a column to store the Dynamics GP backoffice user ID and a column to store a "Person or Group" content type value.  This allows them to create items in the list for each Dynamics GP user, specifying the associated Active Directory user.

From our workflow builder, we lookup the Active Directory user using the SQL User value from the list item.

You will need to ensure all of your backoffice users are identified in the new SharePoint list.  One way to ensure that these records stay in sync, is to create the "User" list from our "New User Notification" template.  This includes an integration on the SY01400 table in the DYNAMICS database, the table that contains all the backoffice users.  Once you have the target "User" list, just add your Active Directory user column to the list.  Now, you can be sure that any backoffice users added to Dynamics GP will automatically be included in the list to cross reference the Active Directory user ID.  Finally, you can put a workflow on the "User" list to have your IT department identify the Active Directory user ID for all new Dynamics GP users.

And the uses for U-LINC continue to grow ...

Custom workflow actions don't work from U-LINC??

Many of our customers are choosing to extend the out-of-the-box SharePoint Designer workflow actions in order to enhance the capabilities of their U-LINC enabled workflows.  Many of these custom workflow solutions (like iLoveSharePoint) will modify the SharePoint web.config file and put their dll's into the "AuthorizedTypes" and "SafeControls" sections.

This "tells" SharePoint that these dll's are trusted and it's ok to execute the functionality within the dll.  These custom solutions are obviously unaware of the U-LINC Web Services.  As such, they do not update the web.config file for the web services.  As such, you may install a new custom workflow action and have it work fine when manually creating/updating a SharePoint list item, however, that same workflow fails when a U-LINC integration creates/updates the same list item.

"Repair Config" to the rescue ...

You can either manually copy out the "AuthorizedTypes" and "SafeControls" entries from the SharePoint web.config to the U-LINC Web Services web.config, or launch the U-LINC Configuration Manager from the SharePoint Server and select to "Repair Config" from the SharePoint Application or Web Services pages.

This will ensure that all entries that exist in the SharePoint web.config also exist in the U-LINC Web Services web.config file.

HERE I COME TO SAVE THE DAAAAY!

Wednesday, May 23, 2012

How do I enable Session State for U-LINC?

U-LINC requires that Session State is enabled in SharePoint. Many systems will not have Session State currently enabled. When the U-LINC Configuration Manager reports that Session State is not enabled, the following procedures should be followed to correct this issue.

There are many ways to enable SharePoint Session State. This documents the simplest, most oft implemented Session State settings.

From IIS Manager:

Select the site that SharePoint is installed into.

Select “Modules”. Ensure that a module is created for the “System.Web.SessionState.SessionStateModule”. If one does not exist, select to “Add Managed Module”, enter a name (e.g. “SessionState”) and select the “System.Web.SessionState.SessionStateModule” from the Type drop down list. Select the OK button.

Select “Pages and Controls”. Ensure “Enable Session State” is set to “True” under “Services”. If set to something other than “True”, set it to “True” and select “Apply”.

Close and relaunch the U-LINC Configuration Manager and ensure that it does not report that Session State is not enabled.

Additional Information from Microsoft on Session State for SharePoint:
http://blogs.msdn.com/b/markarend/archive/2010/05/27/using-session-state-in-sharepoint-2010.aspx

To enable ASP.NET session state:
  1. Enter the following PowerShell command in the SharePoint 2010 Management Shell window:
    Enable-SPSessionStateService –DefaultProvision
  2. On each web application for which you want to use session state, edit the web.config file and set the enableSessionState property of the pages element as follows:
    <pages enableSessionState="true">

How do I embed a graphic into a SharePoint Designer workflow?

Many of our customers want the ability to "pretty up" the emails that get sent out from workflows.  One thing that will help enhance the readability of emails is to embed graphics inside the email.

Within SharePoint Designer, you cannot technically "embed" an image.  However, you can embed a link which points to an image.  That being said, the typical approach is to save an image to your SharePoint site, typically a "Site Pictures" picture library.  Once you have the image you want to embed into your email on your SharePoint Site, simply copy the URL to the image use it within a workflow variable in your "Send an email" workflow action.  To do this, create a "Local Variable" called "ULINC Image", then add an action to "Set Workflow Variable".


Use the following value for your variable, swapping out the URL to your specific URL:
<img src="http://ulinc/Site%20Pictures/ULINCNotification.jpg"/>

Next, add a "Send an Email" action, or select one that already exists.  Open the "Define E-mail Message" window and select to "Add or Change Lookup".  Select the workflow variable for which you just assigned a value.


When you are done, your email should look something like this (note the [%Variable: ULINC Image%] tag):


Once this is complete, finish defining the contents of your workflow email and publish the workflow.  It's that easy ... well it's easy once you know how, and now you do!

Tuesday, May 22, 2012

How do I handle expiration notification workflows?

SharePoint Standard and Enterprise versions contain the ability to implement retention policies.  These retention policies can delete an item/document after a certain period of time, move the item/document to a long term storage location, or even initiate a workflow on the item.

For users who have this functionality, creating an expiration notification for something like a certification is relatively easy.  Simply create the notification workflow that sends an email if the certification expiration date is less than the current date.  Then, setup a retention policy to kick off the workflow.  However, for SharePoint Foundation users, this becomes a little tricky.

The easiest way I have found is to create a PowerShell script and run it from a nightly timer job.  The script would essentially fire the workflow for each of the items in the target list created by U-LINC.  The workflow would look to see if the expiration date of the item is within the specified timeframe and if so, send an email.

Here is an example of a script to kick off a workflow for every item in a list:

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
$site = Get-SPSite http://tfranz6
$web = Get-SPWeb -Identity http://tfranz6/u-linc/department
$list = $web.Lists["Vendor"]
$wf = $list.WorkflowAssociations[0]
$result = $list.Items
foreach ($r in $result)
{
 $site.WorkflowManager.StartWorkflow($r,$wf,$wf.AssociationData)
}


In this script, you would need to modify the URL to your root SharePoint site and the site which contains the target list.  Additionally, you would need to change the list name.  Finally, you will need to determine the correct ID for the workflow association.  If you only have one workflow tied to the list, this is most likely "0" (e.g. $list.WorkflowAssociations[X]).  If you are unsure about the workflow association ID, you can find it by running the following script, incrementing the index ("X") until you find the correct ID.  There is probably a better way to do this, I just didn't find it easily.

$site = Get-SPSite http://tfranz6
$web = Get-SPWeb -Identity http://tfranz6/u-linc/department
$list = $web.Lists["Vendor"]
echo $list.WorkflowAssociations[0].Name

Once you have your PowerShell script created, simply save it with the .ps1 extension.  You can then create a batch file that launches PowerShell and executes your script.

powershell -noexit -file "c:\ExecuteNotificationWorkflows.ps1"

You can then call your batch file from a Task Scheduler job (Control Panel > Administrative Tools > Task Scheduler).

This approach should work with all of our timed notification workflow templates.

Now that' just cool, I don't care who ya are!

Wednesday, May 16, 2012

Link your Dynamics GP entity to anything ... sounds cool huh?

One cool "extra" that comes with the Dynamics GP Adapter for U-LINC is the ability to link an entity (vendor, customer, employee, sales transaction, etc.) to a URL.  Then navigate to that URL from a Dynamics GP Window.


Note the "i" icon on the top right of the window?  In this case, click on the link opens a SharePoint document library containing all the PO's for the selected vendor.

Conceptually, you could link to anything ... from document libraries, to portal sites, to pdf and Word documents.  If you can build a hyperlink to it, you can create a connection between a Dynamics GP record and that object.

The obvious next question is, "So how do I identify the specific URL for the selected record?"  It's actually quite easy, open the target SharePoint list for the integration to the table that contains the record, and find the associated list item.  Open the item and set the "More Information URL" to the desired value.


Once you save this change, the icon will appear for that record in Dynamics GP.

While this approach may be labor intensive, you can automate the population of this field from a SharePoint workflow.  Simply create a workflow that sets the field value when an item is added to the list.


The key in this scenario, is that the URL is consistent for all vendors, save the Vendor ID.  We get that from the current list item and use it in the URL as a variable.

With this feature, U-LINC can now "LINC" Dynamics GP to SharePoint to provide a rich end user experience ... hope you enjoy this feature!

(Note: this feature is near and dear to me ... I coded this on a weekend after a meeting with a partner who thought that's what U-LINC did before we showed him what it actually does ... :-)  Hope you like it as much as I do!)

Tuesday, May 15, 2012

How do I create workflows with SharePoint Designer?

SharePoint Designer 2010 is an easy to use, free tool available from Microsoft.  It has the ability, among other things, to build workflows on SharePoint lists.  With U-LINC, you can populate a list with the information that is critical to your business process, then using a tool like Designer, put a workflow on that list.

Download link - 32 Bit
Download link - 64 Bit
(Note: If you have Microsoft Office 32-Bit installed, you will need to use the 32-Bit version of Designer.)

SharePoint Designer 2010 can be installed and run from the SharePoint Server or a client machine.

Once installed, simply launch the application and connect to the SharePoint site where your target was created by U-LINC.  Navigate to "Lists and Libraries" and select your target list.  Select to create a "New..." workflow, give your workflow a descriptive name and OK.  The workflow editor will open and you are ready to start defining your Steps, Conditions and Actions.

Below are some links to help you learn how to build your workflows:

SharePoint Designer Workflow - office.com (reference guides, tutorials, video's)
Google Search

Remember, you can extend the functionality of your SharePoint site by deploying extensiblity tools, some of which are free.  The "How does U-LINC work?" post talks about some of the tools available.  The most often asked for feature, is the ability to interact with the ERP data from the workflow.  For example, they may want to inactivate a record until an approval process is complete.  There are two common methods for accomplishing this, both utilize the free iLoveSharePoint custom workflow actions.  One workflow action is "Execute SQL".  This workflow action allows you to build a dynamic T-SQL statement that you can execute within the workflow.  The other action is "Call a Web Service".  Depending on how complex your data interaction is and whether or not there is existing business logic you can utilize will determine which action you want to use.  The "down and dirty" approach is to do a simple table update from the "Execute SQL" action.  A more elaborate implementation would be to use eOne's SmartConnect tool to build a map, then call into their web service referring to the map ID.

Now ... go build a workflow, it's really not that difficult!  And have some fun learning something new in the process ...

Monday, May 14, 2012

My workflows won't fire ... what's up?

There are several reasons why your workflow may not be firing automatically.  The most common reason is that the edit to the SharePoint list item was initiated by the "System Account".  This is easy to check, simply open the SharePoint list item that was created and scroll down to the bottom of the window.  You will see who last edited the item.  If it say's "System Account", there is your answer.


You might be thinking, "But this was edited by editing a SQL item, U-LINC updated the SharePoint list item ... not the system account".  If that is the case, then you need to see what user the U-LINC Web Service Application Pool Account is referencing.  If it is a SharePoint system account, you will need to change it to an account that has "Contribute" access to SharePoint and has "sysadmin" priveledges to the SQL instance hosting your SharePoint content database.

To check this, launch IIS Manager, and select the "Advanced Settings" for the U-LINC site.


Make note of the Application Pool name.  Then open the "Advanced Settings" for that Application Pool Account.  You can change it to your new account and voila, your workflow fires ... hopefully ;-).


 If not, you might check your workflow settings in SharePoint Designer and ensure the "Start Options" are marked correctly.


Hope this helps ...

I have an overlapping integration for the template I want to import, what are my options?

When the system determines that you have an overlapping integration, you have a couple options.  If you are simply wanting to see how this particular template is put together, then enter a unique "Integration Name" prior to importing the template.  The U-LINC Configuration Manager (UCM) will create a new integration that will be "Inactive".  We only allow one active integration per primary table, therefore, if you have another integration for the same primary table that is active, you will not be able to activate the downloaded template integration.

The obvious next question is, how do I import a template which has an overlapping integration and be allowed to activate both?  The answer is to ensure the "Integration Name" for the template you are going to import is the same as the existing overlapping template.  During the import, the UCM will merge your existing integration with the template integration being imported.  It's important to know that these changes will be effective immediately, so if your current integration is active, U-LINC will immediately begin sending the information to the target SharePoint list.  However, the imported template workflow will still need to be published prior to using the new template.

Hope this is helpful!

(Note: This approach was changed and will require U-LINC version 1.2 or later. There is a different method for the RTM version that is still supported in 1.2.)

Thursday, May 10, 2012

U-LINC Security Requirements

When implementing any enterprise software, security is usually a significant part of the implementation.  While we attempted to mitigate as many security requirements as possible, security issues continue to be at the top of our support list.

Understanding the pieces that comprise the U-LINC solution will help end users and partners to identify what potential issues may crop up during implementation and use.

There are three key components to U-LINC Foundation:
  1. SharePoint Application
  2. Web Services
  3. SQL Triggers
From a setup perspective, SQL Server needs to be able to access the Web Services.  Web Services needs to be able to access SharePoint.  SharePoint needs to be able to access SQL Server.  Additionally, if you are using an ERP adapter, the adapter needs to be able to access the Web Services.

Workflow initiation scenario:
When data changes in SQL Server, a trigger fires which contacts the web services.  The web services then interact with SharePoint to create an item in a list.  Once the list item is created, a SharePoint List workflow is initiated.

Creation of an integration:
When a user wants to create a new integration, the SharePoint application creates a trigger in SQL and creates a new list to house items created when data in SQL changes.

Adapter workflow visibility:
When a user displays a record in an ERP system using the associated adpater, the adapter gets the workflow state of the current record using the web services.

Seeing now how these systems interact, you can begin to infer the security requirments. 

In order for SQL Server to authenticate to the U-LINC Web Services, the SQL Server process account must be a domain account.  By default, all domain authenticated users can access the U-LINC Web Services.

In order for the U-LINC Web Services to perform its necessary actions, the application pool account associated with the IIS web site hosting the web services must have "Contribute" access to the SharePoint site where the U-LINC SharePoint application is installed.  Additionally, the application pool account should be a SQL sysadmin on the SQL Server instance which hosts the SharePoint content database.

When the SharePoint application creates SQL Server triggers, it can use Windows Authentication or SQL Server Authentication to make the connection.  This is defined within the U-LINC Application Source.

Our standard recommendation is to create a new domain account and grant the following privileges to the account:
  1. Domain User
  2. "Contribute" access to SharePoint
  3. "sysadmin" permissions to SQL (hosting SharePoint content database)
This account would then be used as the SQL Server Process Account for the SQL instances that house the data you want to do workflow "stuff" on.  Also, this account would be the one used when deploying the U-LINC Web Services from the U-LINC Configuration Manager.

This post covers a portion of the overall security implications of U-LINC.  In a later post, I will cover best practice recommendations for securing your lists which contain the data used for workflow activites.

Wow ... this is fun ... more to come ...

Wednesday, May 9, 2012

How do I link to the U-LINC "Workflows" SharePoint window from an email?

When creating a SharePoint workflow, you may want to include a link to the U-LINC "Workflows" window to ease the navigation to assigned workflow tasks from an email sent to the "Assigned To" user.  This is quite easy to do. 


This window will show all running workflows as well as their associated tasks including a history of completed tasks associated with the selected item.

You will want to gather a couple pieces of information from the "Integrations" window in the U-LINC SharePoint application.  You will want to make note of the URL to the site in which U-LINC is installed.  Also, you will want the exact name (case is important) for the target integration/list.  In this case my site URL is http://tfranz6/ulinc and the target integration/list name is "Employees".


From SharePoint Designer, or your SharePoint workflow builder of choice, simply create a "Click Here" hyperlink and for the Address of the hyperlink, put in the following:

You will want to replace the highlighted snippets with the associated information you previously gathered.  Also, the [%Current Item: ID%] was added using the "Add or Change Lookup" button and selecting the ID from the Current Item.


Hope this helps!

(Note: This approach was changed and will require U-LINC version 1.2 or later.  There is a different method for the RTM version that is still supported in 1.2.)

How do I install/configure U-LINC?

The installation and initial configuration of U-LINC is handled by the U-LINC Configuration Manager (UCM).  The UCM has its own lightweight installer that lays down some files on the local server.  The UCM must be installed on a SharePoint front-end server and the SQL Server hosting the data that workflow "stuff" needs to occur on.

Once the UCM is installed on a SharePoint front-end server, simply launch the application and work top down through the navigation pane on the left side of the main application window.



The first step after launching the UCM is to publish the SharePoint Application.  Next, we deploy the U-LINC Web Services and activate the product.

If the SharePoint front-end server is also hosting the target SQL databases, you can configure those databases for use from the same instance of the UCM you have already used.  Otherwise, you will need to install the UCM onto the SQL Server.  From the SQL Server, you can select the databases to configure for use with U-LINC and Activate those.

At this point the U-LINC foundational components are all installed and you are ready to begin building workflows on your business critical data.  If you are using Dynamics GP, you will want to install the correct adapter (Dynamics GP 10.0 & later are supported).  The adapter allows you to expose workflow information inside of the application as well as enforce UI constraints for records that have incomplete workflows.

This is just an overview of the installation routine for U-LINC.  You will want to refer to the installation documentation for a complete set of instructions.

So the most obvious question is, how do I download the install?  At this point, we are requiring our -U-LINC partners to complete the partner training prior to accessing the install.  Customers will want to work through their partner to obtain the install.