After struggling with this for a few days, we discovered an interesting problem when syncing users from Active Directory to SharePoint. Our disabled accounts, which are moved to a disabled OU (organizational unit) in Active Directory were not showing up in SharePoint, however disabled IT account were still visible. Our Active Directory structure looked something like this (this is a very simplified version):
The accounts in the Disabled OU did not show up in SharePoint, but the Disabled IT accounts did. There is a simple explanation for this, per this technet article:
“There is currently no utility that allows you to select a parent OU while excluding any of its child OUs from synchronization.”
Because we were syncing the IT OU, it was syncing all of the children, both Disabled and Active. The solution was to move the Disabled IT directory out of the IT OU, so our new structure looks like this:
Once this was done, we ran a Full sync of the User Profile Application Service but the disabled account still showed up in search. Why? We needed to run a Full Crawl of Local SharePoint Sites as well. Once that completed, the disabled IT accounts were gone.
Pt. 1 Fixing Multi-Choice Column
Pt. 2 Changing Grouped By Views
Pt. 1 Fixing Multi-Choice Column
We use jQuery across SharePoint to make a lot of UI and UX corrections. One of our most common UI corrections is for displaying choice column values in lists views that are multi-select. If you have list with a choice column and allow users to multi-select more than one option it will get displayed in the list view as: [choice1],[choice2]:
This is great for parsing data but our end users hate it and I agree that from an end user standpoint you’re expecting to see choice1 and choice 2 horizontally displayed without the “,” delimiter.
There is a simple solution for this:
Here, we need to know the column number and in the above the choice is the fourth cell in each row of the table or the fourth column. (The check and ellipsis are cells or columns of their own). The delimiter in this case is a “,” , so we want to find all instances of the “,” in the html. If you include a string “,” here it will only match the first instance. The regular expression /,/g will find all matches. Finally we want to replace with a <br> tag and push each choice to the next line. Knowing that we iterate through each tr and find the column number and get the html. Then we replace all instances of the delimiter with the <br> tag and finally set the html to our new variable to get the below:
This is best abstracted and called as a global function whenever you need it. Also note that other columns types will delimit by other delimiters like “;”.
I’ve made two posts about this in the past: one about running previous versions of workflows and another about workflows not publishing.
In the first post, I discovered that when running workflows in the 2010 platform previous versions may need to be deleted; in the second, I found that the activity cache on your local machine can prevent new versions of your workflow from being published.
This post is related. If a workflow fails to run with the error: something went wrong to try again reload the page and the start the workflow, you may need to restart two services. To do so check the server SharePoint is on and look for the two services:
- Service Bus Gateway
- Service Bus Manager Broker
If either of these services is stopped, restart them and try to rerun your workflow.
So this can be incredibly frustrating. You update a workflow, save it without errors and then publish, but the next time the workflow runs your changes aren’t there and it’s running an older version. I have a post about dealing with an issue like this, but after following my own advice and clearing out the previous versions, I still had the same problem . I stumbled upon this blog post that explains the problem. There is a SPD activity cache for your local machine and clearing that out will solve the problem.
The path for me on 64 bit Windows 7 looks like this: %System Drive%\Users\%user name%\AppData\Local\Microsoft\WebsiteCache. Inside that directory there was a folder for each SharePoint site I have worked on and occasionally an identically folder with “01” or “02” after the name. All of these directories can be deleted. Make sure you have closed SPD designer before deleting the directories, then reopen designer and publish a workflow.
Stumbled upon this post when trying to use the ULS logger to see an error:
See the blog above for full details but here is a simplified way to get an error:
1. Get correlation id from window
2. in PowerShell (run the following commands):
Merge-SPLogFile -Path “.\error[x].log” -Correlation “85ea729c-071c-d0b1-d6c7-065c6284a50f”
I name my log errorx where x is a number and delete them after I I’m done.
Saves to C:\Users\ [your user name]
3. Open ULS Viewer > Open File and select error[x].log
Way easier than hunting through ULS logs.
By default Content Query Web Parts (CQWP) don’t display any text on a page when no results are returned. The message is only displayed in “edit mode” when a content manager or developer is editing the page. This can be frustrating because you might want to display a message that says that nothing has been returned. In my case we wanted to query a calendar for upcoming events that meet some conditions and a message if there wasn’t any. The solution is simple:
1. Open Designer and your root site collection (http:// [site collection name])
2. Select All Files > Style Library > XSL Style Sheets
3. Open ContentQueryMain.xsl (good idea to make a copy called custom)
4. Look for the item template OuterTemplate.Empty:
Note the xsl:if tag that indicates that the message will only be shown when in edit mode. Add a custom message above.
Lately, for me, it seems we have to come up with creative solutions around SharePoint constraints. Recently, I found a quick way to display the attachments column of list in a Data View:
<xsl:attribute name=”ItemId”><xsl:value-of select=”@ID”/></xsl:attribute>
The result is a clean Data View with all attachments for that list item shown. Quick trick to make sure attachments are displayed when you might need them.