by

How To Separate Multiple Users Selected with InfoPath People Picker–No Code

If you reached this page, you’re likely looking for an answer to the dreadful issue of how to separate the selected users from the InfoPath People Picker control in a string. Well, there are a few solutions using code, but if we can come up with something that does not need to use code deployment, any web services etc. and it is good enough, then this is your answer.

First of all this is the structure we will be using in this example:

infopath-xpath-expression-people-picker

Note the pc: Person has a blue arrow? That’s the catch. The People Picker is actually a Repeating Table with a person object underneath! Keep that information for now, we will come back to it in a minute and it all will make sense. Smile

Next thing we will do is to add a regular textbox control to your form. Click “Properties” and then choose to define a formula for the default value. Also make sure the “Refresh value when formula is recalculated” is checked.

infopath-xpath-expression-people-picker-semicolumn-text-properties

In the default value dialog box, click “Edit XPath (advanced)”. Here we will use a combination of 2 powerful functions: xdMath and Eval. Essentially xdMath will recalculate the position of the xml node in the parser and the Eval an loop though collections.

Remember when we saw that People Picker control is a Repeating Table? yep, a collection. So we will use the Eval to navigate the rows of that collection, and using Concat in the create a string attach a semi column at the end of each row.

infopath-xpath-expression-people-picker-semicolumn

Don’t worry about the advanced bit, It took me a bit to get the XPath formula right. So skip thinking about it and here’s the expression all nicely done for you.

 

xdMath:Eval(xdMath:Eval(../my:ReviewTeamSection/pc:Person, 'concat(pc:DisplayName, "; ")'), "..")

 

Make sure to replace the my:ReviewTeamSection path and use yours instead. Also you can play around with the XPath expression above and replace DisplayName for AccountId or AccountType to get different values.

I hope the time I spent figuring this out can be used to save yoursSmile

 

By

by

How to Fix: Restore-SPSite. The site collection could not be restored. Content Database, Sufficient Free Space.

If you try to restore a site collection backup from another location, performing a simple Lift-and-Shift, you might be confronted with the following error:

restore-spite-error-space

“Restore-SPSite : The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space.”

What this Error Means?

In short, it can be MANY things. You know that your database actually has enough space for the restore file. You know that you have the right permissions. You check that the command actually runs for a period of time… and yet, after several minutes the restore operation fails.

What’s Causing This?

Unfortunately, like many warning emitted by SharePoint, this error sends a message which leads to an incorrect conclusion.

Let’s read again this warning, slowly and we will discover that it actually says: “…please make sure you have enough space…”, this is not saying that you don’t have. That’s very tricky and misleading, because it leads people to believe that “hey, such a trivial operation doesn’t work, must be space related”

What to do?

Actually this is a blanket message, a very high level warning covering the real cause of the problem. So, next time you see this check the SharePoint error logs. The first thing you should do is: in the error trace level, keep an eye in the “High”, “Critical” and “Unexpected” types. They will clearly indicate the error that this message is covering.

It might be a database permission problem, it might be a corrupted restore file, if could be a failed SharePoint service. I’ve seen this error message a few times already and both times they had nothing to do with space in the database server. For example, last time I saw this error message it was nothing to do with SQL server space, it was a corrupt backup file.

corrupt-backup-file-encountered

So, next time you see this error message, remember: thing are not really what they seem! especially in regards to SharePoint Smile

By

by

How to Fix: “The process cannot access the file” Error on SharePoint 2010

Most the developers I know have a stand-alone deployment of SharePoint in their own laptops, it gives them the capabilities of SharePoint without having to go with a full-blown SharePoint 3-tier farm. However most of the times they try to upgrade from SharePoint 2007 (aka. MOSS) to SharePoint 2010, they are confronted with the following and annoying error message:

“The process cannot access the file '<Path\FileName>' because it is being used by another process.”

 

The Issue:

Just so you know, when SharePoint configuration says "files are locked", what it really means is "a few rows in the SharePoint configuration database are locked for updates." These are not really real files in the sense of our windows explorer files. And that sort of behavior is as expected and per design by SharePoint. The Timer service is supposed to have this power to lock/update/release resources in the SQL Server; Unfortunately, a few times the locks are not released properly or quickly enough for the upgrade to continue Smile

The Fix:

In the start Menu of your SharePoint server, call the “services.msc” shortcut, this will lead you to the Services interface running in the local machine.

services-msc

Once there, find the “SharePoint 2010 Timer” and double click-it so you can see the “SharePoint 2010 Timer Properties”

sharepoint-2010-timer-service 

IMPORTANT: In the properties select “Manual”or “Disabled”. You need to perform this step in order to force the service to release the hold on the files.

sharepoint-2010-timer-service-properties

Then restart your machine. When the server is back online again,  call the “SharePoint 2010 Products Configuration”, this will realign the Sharepoint Timer Service and will fix your new upgraded server.

sharepoint-2010-configuration-fix

I know it sounds weird this solution to “restart and everything will be OK”, but that’s how it worked for me and some friends a couple of times already.

By