Getting Values from a Multi-select People Picker in VS Workflow

If you are trying to get a value from a multi-select people picker in workflow in the same way as you would from a single select people picker, then you are going to have problems.

I came across a great post (my salvation) here:

http://sharepoint.stackexchange.com/questions/78125/workflow-sp-2013-cannot-retrieve-a-usermulti-field-value

-which saved me a lot of time and headache. But just incase  I’ve posted a screenshot below. Worked a treat for me (in this example, the multi-select people picker field is called Members).

MultiPPValueWF

Advertisements

Missing Metadata in Document Copy / Move

Have you ever used the Send To function in a document libray to send a copy of the document to another library? Maybe you have used explorer view to copy or move a document between libraries.  If you have set up the same site columns in the destination site and library then you should see those metadata values set on the source document, brought across on the document copy. If some values are missing and you are scratching your head wondering why, then think back to when you first created those site columns. Did you change the name or one at some point? Even if you changed it back to what it was, or to match the site column name in another site, SharePoint still sees the column with its original title. You need to delete the column that was renamed and recreate it with the matching title. Make sure that the site columns also have the same metadata values on each site/library and then all metadata selections should come across with the copy/move.

I hope you caught it early enough to avoid some serious document metadata updates 😉 Goodluck

Problems with SharePoint List Item Events

Anyone who has had to develop a SharePoint event handler has probably run into some trouble. This path is fraught with danger and as far as I can see the general advice when coming up against an issue is “gorn work around it and leave me alone”. So here are some links and tips for getting past the usual suspects:

Event Trouble Shooting  -is this a known problem or are you just “Special”

Codeplex Handler Management Page – this is a handy feature that allows you to see what handlers are associated with a site, list, content type..

Everything Eventful – great post for Getting Started with SharePoint events.  Everything from writing a receiver to attaching and troubleshooting.

Tip – When in doubt, used ED events instead of ING events. Make sure you do some of this though:

 bool auu = web.AllowUnsafeUpdates;
                web.AllowUnsafeUpdates = true;

….. do stuff to handle the event

 this.DisableEventFiring();
                    item.SystemUpdate(false);
                    this.EnableEventFiring();
                    web.AllowUnsafeUpdates = auu;

Tip- Document libraries are a bit different from standard lists. Mainly because when a document is uploaded, there are 2 sets of events. You will notice that when you upload a document, if you click Cancel at the Edit Form (complete doc metadata stage), the document will still appear in the library. So the itemadding, added, updating, updated events have fired already. When you complete the metadata for the document, they fire a second time.

Tip- Check your fields are A-OK. If you have a faulty field definition deployed uisng a feature it may have an invalid attribute that was not revealed when it was deployed. Sometimes this can cause items to ignore new property values altogether. Try removing custom fields and updating/adding items to see if the problem persists.

Other oddities

Happy Handling.

Document Library Default Content Type Always Used

During the development of a big fat SharePoint solution which rolled out site columns, content types, lists and pages and linked all the relevant bits together, I came across a frustrating issue. When I was uploading a custom document content type on a library it was always defaulting to the Document (or default) content type after the item was uploaded.  I found this blog post which gave me some ideas but after re-creating the document library and re-adding the content types but I still had the same problem. The issue was due to a “faulty” field in all of my content types. I had done the ol cut-and-paste for some of my field definitions and had a [NumLines] attribute associated with a date field. Narf. Removing this attribute and recreating the field resolved the problem.

If you are noticing something like this when uploading  Word documents but it is not occuring with other types of documents- such as a PDFs, try clicking New -> Content Type on the library menu so that Word is launched , and make sure you have the Document Information Panel displayed. If there is a problem with one of the metadata fields then you might see some kind of error here which could identify the culprit.