Tuesday, June 30, 2015

Visual Studio 2012 Missing SharePoint 2013 - Empty Project Templates

If you are missing the SharePoint 2013 project templates in Visual Studio 2012 and you are trying to get the templates installed, you can go here to follow these instructions: 

However, trying to install them with the installer did not work for me. I got an "installation blocked" error that is almost certainly due to some special security hardening policies on the server.
However, the direct download did work.

Tuesday, June 16, 2015

Nintex: show user's display name instead of user ID in notification

There are three methods to show a user's display name (instead of a login ID) in an email notification. 

1. Set a Variable

1. In your list, create a column of type People Picker and name it Person.
- Set a workflow variable: displayName
2. Set Variable (workflow action)
- Set: choose workflow variable displayName
- Equals: User Profiles
Source: Name
Equals: List Lookup
Source: Current Item
Field: Person (your people picker column from your list)
3. Send Notification
- Insert reference to workflow variable displayName

2. Call Web Service

1. In your list, create a column of type People Picker. In this example, it is named Person.
In the workflow, create two variables:
- DisplayName - single line of text
- xmllResult - Single line of text
2. Call Web Service
- URL: http://yourserver/sites/yourSite/_vti_bin/UserGroup.asmx
- Username, Password - Choose an account that has at least read only access to your site
- Click on Refresh
- Web Method: GetUserInfo
- Editor Mode: SOAPBuilder
- Web service input: insert a reference (icon of a book to the right of the field), Item Properties, then click the Person column.  Click OK.
- Store Result in: (workflow variable) xmlResult
3. Query XML
- XML Source: XML
- XML: Insert Reference to the workflow variable xmlResult
- Output 1, Process using: XPath : //@Name
- Store Result in: (workflow variable) DisplayName
4. Send Notification
- Insert reference to the workflow variable DisplayName

3. Query LDAP

1. In your list, create a column of type People Picker. In this example, it is named Person.
In the workflow, create one variable:
- DisplayName - single line of text
- userID - single line of text
2. Build String - Use the fn-replace function to strip out the claims token from the User ID in the Person column.
- Text: fn-Replace({ItemProperty:Person},i:0#.w|domain\,) (replace text in red with a reference to the Person column., replace text in green with your domain.)
- Store Result in: (workflow variable) userID
3. Query LDAP - query Active Directory with the userID to get the display name of the user
- LDAP Path -  Click on the ldap picker icon. The right path is usually visible by default.  It will look something like this: LDAP://DC=domain,DC=dc,DC=dc,DC=com.  You may have to type it in.
- Username, Password - enter an account that has at least read only access to active directory. 
- Query - (&(objectClass=user)(samaccountname={WorkflowVariable:userID}))
Replace the text in red with a reference to the workflow variable from the previous step, userID
- Property to retrieve - type in "displayName" (no quotes), then click on Add.
- displayName drop-down write to variable DisplayName.
4. Send notification and insert a reference to your variable, DisplayName.

Monday, June 15, 2015

Nintex: Make Dynamic Link to Filtered View of Library

  1. A user enters a project request in a custom list (Project List).  A workflow goes through an approval process, then when it is approved (a column value set by the workflow), a group of documents is copied from a Template Library to the Active Project Documents library, where the documents will be worked on.  T
  2. In the Active Project Documents library, one meta data column will be set by the workflow:  Project Name
  3. The Project List will have a link to the Active Project Documents Library - a filtered view that shows only the items with the project in question. 
Workflow Steps
There are multiple ways to accomplish the goals, but this is the way I found in my environment.  This workflow kicks off after the project approval process.

Before getting started, create a variable called URLToProjLib.  Make it a string.
Make sure you have a column in this Library of type URL, as well as a Project Name field - type single line of text.
  1. Update Multiple Items 
    • This step updates a field called "Project Name" in the template library.   This is in preparation to copy the item to Active Projects with the right meta data
  2.  Copy Item
    • In this case, I want to copy an item from the Template Library to the Project Library when the document type (a meta data column available in both libraries) is equal to Project Plan. 
  3.  Update Multiple Items
    • I do the same as step one, except I fill in the value "none" in the Project Name field.  This step isn't needed to make this workflow work.  It just cleans things up in a way that is appealing.
  4.  Regular Expression
    • The goal of this step is to replace any spaces in the Project Name field with the characters "%2520".  This is how it would look in the URL for the filtered view.
    • Pattern: \s
    • Operation: Replace text
    • Replacement text: %2520
    • Input text: Insert reference to Project Name column
    • Store result in the variable you created earlier: URLToProjLib.
  5. Build String
    •  This step builds a string that will fill in a field of type URL.  To do that, you have to have this pattern - http://url, display.  The url, a comma, then the display name.
    • Get URL to your document library filter.  To do that, go to the library, filter on the column you want.  Copy the URL.  Example: http://sharepoint/sites/nintex/Project%20Library/Forms/AllItems.aspx#InplviewHasha9c67577-f3ef-4416-baf4-50d33aca4de7=FilterField1%3DProject%255Fx0020%255FName-FilterValue1%3DUpgrade%2520project
    • In this example, the field project name is being filtered on. The highlighted text is the value being filtered.  Copy everything but the highlighted text into the Text space in the Build String editor.  Example shown in red below.
    • Add the URLToProjLib variable (in blue below), then a comma, a space, then a reference the the Project Name column (n orange below).
    • Text - http://mysharepoint/sites/nintex/Project%20Library/Forms/AllItems.aspx#InplviewHasha9c67577-f3ef-4416-baf4-50d33aca4de7=FilterField1%3DProject%255Fx0020%255FName-FilterValue1%3D{WorkflowVariable:URLToProjLib}, {ItemProperty:Project_x0020_Name}
    • Store the result in the URLToProjLib (it will overwrite the previous value)
  6. Set Field Value
    • Set the value of Project Documents (your URL column) equal to workflow data.  Choose the URLToProjLib.  Then, click the ellipsis next to the drop-down and choose Plain Text for the return type.

Add metadata to a link in a document library - SharePoint 2013

A user wanted to add a link to another document to a document library.  However, the user had views set up based on metadata, but when you add the Link to Document content type in the library, it doesn't allow you to add metadata to it by default.  Which, in this case, made it unusable if it couldn't be shown in the right view.

You can add your document library columns (metadata) to the content type in your document library.  This affects only the single document library.  There are solutions that suggest adding these columns to the site content type, but this is too broad of a change.

Steps to take:

There are two steps to making a link in a document library.

11. Add content type to library
·         Go into your document library settings.  (Library -> Library Settings)
·         Click on Advanced settings, then change Allow management of content types to Yes.
·         In between General Settings and Columns, there is now a new section called Content Types.  Click on Add from existing content types.
·         Highlight Link to a Document, then click on Add >.  Click on OK.
2 2. Add your columns to the content type (so you can assign values to the columns when you add a link)
·         Under Content Types on your settings page, you should now see at least two content types – Document and Link to a Document.  Click on Link to a Document.
·         Under Columns, click on Add from existing site or list columns.
·         Change the drop-down to List Columns (if it isn’t selected already)
·         Highlight the columns you would like to be able to use on the link and then click on Add >.  Click on OK.

After doing this, when you create a new column, there will be a check-box (checked by default) that adds it to the content type automatically, so future metadata you set up will automatically be available to the link content type.

Wednesday, January 21, 2015

Document ID Service Enabled, But the Document ID Column Does Not Appear

You enable the document ID service on a site collection and go into document ID settings to set an ID for all documents on the site collection, but no document ID appears when you view properties.

I had to do all of these things before the document ID column appeared:
  1. Enable the feature on the site collection.
    1. Site Settings -> Site Collection Administration -> Site Collection Features -> Document ID Service.  Activate.
  2. Start the Document ID feature
    1. Site Settings -> Site Collection Administration -> Document ID settings.
    2. Check the Assign Document IDs checkbox and click on OK.
  3. Adjust the default content type read/write.
    1. Site Settings -> Site Collection Administration -> Content Type Publishing
    2. Check the box for Refresh all published content types on next update, click on OK.
  4. Run some Timer Jobs in Central Administration
    1. Central Administration -> Monitoring -> Review Job Definitions
    2. Change the view to Web Application and choose the Web application that contains the site where you want to see the document ID service
    3. Run: Content Type Subscriber
    4. Run: Document ID enable/disable job
    5. Run: Document ID assignment job
Disclaimer: I was experimenting when I was researching and compiled this from multiple blogs and microsoft pages.  It is possible that you will have to adjust the order of the running the jobs in central admin.  Let me know if you find that you have to run things in a different order than listed above.

Wednesday, December 17, 2014

Error: "This item is no longer available. It may have been deleted by another user. Click 'OK' to refresh the page."

On a site that has been upgraded from 2010 to 2013, users are getting an error when clicking on the down-arrow on a list item.  The error is "This item is no longer available.  It may have been deleted by another user.  Click 'OK' to refresh the page."

The drop-down arrow is a clue... during the upgrade, it should have converted itself to the ellipsis. When clicking the drop-down, it is actually referencing a file does not exist in 2013.

There were many solutions I found on the Web, some included opening SharePoint Designer and hiding the corrupted view, some involved adding a file that the drop-down is looking for to the server.  In the end, I found those unnecessarily complicated.  This are the steps I took.
  1. Rename the corrupted view from Active.aspx -> Active2.aspx.  (mine was a tasks list)  At this point, you will not have the option to delete the view.
  2. Create a new view called Active and choose the same options as the old one.
  3. Delete the old view.

Monday, October 20, 2014

SharePoint Designer Error when Opening a Workflow: Unable to load workflow actions from the server. Please contact your server administrator

When trying to load a SharePoint 2010 workflow using SharePoint Designer 2010, an error message appears: "Unable to load workflow actions from the server.  Please contact your server administrator."

A feature was missing on some of the SharePoint servers.

I ran a fiddler trace to find out what the issue was.  I got a code 74 in Fiddler, then saw what it was looking for.

Then, I logged on the each of our SharePoint servers and found that on half of them (I have 6), the Powerview folder was missing from the C:\Program Files\CommonFiles\Microsoft Shared\Web Server Extensions\14\Template\Features folder.  I copied the entire Powerview folder from a server that had it to the servers that didn't.  Then, I did an IIS reset on all servers in the farm (although I suspect it would only need to be done on the servers where the files were missing).

I re-opened SPD and opened the workflow without issues.