Skip Ribbon Commands
Skip to main content

Ben There, Done That

:

SharePoint Ben > Ben There, Done That
A SharePoint Blog about where I've been with SharePoint, what I've done with SharePoint, and anything else SharePointy, I care to blog about.
May 14
Using JavaScript on your Office 365 Public Site

A couple months back I was working on an Office 365 public facing site and needed to add some JavaScript to the site.  In this case I was just trying to add Kontactr to a page.  I know, once of the gadgets with Office 365 is  Contact Us, however it is missing the CAPTCHA, something I really enjoy having to reduce the amount of spam.

My first approach was the typical SharePoint approach, just stick a content editor web part on the page and paste the HTML in.  With Office 365 it was place the HTML gadget on the page and paste in the JavaScript.  Unfortunately it didn’t work.

So, how do you do it?  I found this post explaining it - http://webbrewers.com/cata.aspx#3.  When adding references you need to wrap them in a form tag like:

<form action="">
  <input type="image" style="display:none !important;">
  <script type="text/javascript" defer="defer">id = 117156;</script>
  <script type="text/javascript" src="http://kontactr.com/wp.js"></script>
</form>
Hope it helps!
March 28
Auto Populating (and Creating) Word Documents from a SharePoint List

I can’t take all the credit for this post, it is a combination of knowledge gleaned from 3 different posts (see references at the end of the post) and some playing around on my part.

To start with, a little background.  The environment I created this in is SharePoint 2010 Enterprise (no InfoPath forms services).  We needed to be able to allow users to add/update items in a SharePoint list and from that list item generate a document that could be be submitted (emailed or faxed) to the proper parties.  So, how did we do it?  A standard SharePoint List, a custom SharePoint Designer Workflow and a custom Word Document template on a document library.

The first thing to do is to create your Word Document.  That simple, just open up Word 2010, create a document and save it as a .docx file (I tried .dotx initially but had some issues).  Then upload this to the Forms folder in your SharePoint document library.  Once this has ben uploaded, go the advanced settings within your document library settings.  Type (or paste) in the relative URL to your uploaded Word document (i.e. DocLib/Forms/mydoc.docx).  After this has been filled in, click “Edit Template” directly under the text box.  This should open your Document.  Switch to the Insert tab in the ribbon, click “Quick Parts”, hover over Document Property, and you should see all the metadata properties (list columns) from your SharePoint Document Library.  At this point in time, feel free to go back to your SharePoint document library and add any additional columns you may need.  Note: I initially tried the above process using Content Types and didn’t get the same results.  My custom columns weren’t showing up in the Quick Parts.  Not to say it isn’t possible and I won’t try to figure it out, I just didn’t spend the time on it for my quick prototype.

So, now every time you create a new document in the library, it will pull that documents metadata and insert it into the appropriate controls within the document.  But, what if a field isn’t required and sometimes come back blank?  If you try to print the document, you get [Field Name] for all blank fields.  Not exactly what I hoped for.  Good thing is, it’s easy to fix.  For more details, pics around this process, see the third reference below.  Quickly, the process is:

  1. Add the Developer Toolbar to the Ribbon
  2. Select the Developer Tab
  3. Click on “Design Mode”
  4. Where you have the [FieldName] Text in your controls, replace it with a space (you can’t leave it completely empty)
  5. Now when you open your document, any blank field will just be a single space

 

Finally, the good stuff, you have a document, you can auto populate fields in the document from the metadata, but how do you get that metadata there and auto generate the document from a list item?

Workflow!

For this, just start by reading the “List fields + Workflow = controlled Word document” reference below and skip down to Step 3.  (1 and 2 are just restating what I have above).  But don’t do too much yet.  One that that is mentioned in Step 3 is that your custom list and create the same columns as you did for your Document Library.  You actually don’t have to do this.  For instance…I have several choice fields in my custom list.  For arguments sake, lets say with 4 items.  In my document library, I have one column for each possible choice (4 single text fields) because I want to “fill in” certain text in my document based on the choice made.  This also included the use of several Workflow variables.

Ok, now go ahead and start your custom list and workflow.

This should give you a good starting point, feel free to get creative with the workflow.  I actually added an approval into my workflow so that unless the add/update of the item in my custom list is approved, the document won’t be generated.

I also made extensive use of Workflow Variables, in some cased, combining fields from my custom list into a single variable to then place that variable within a field on my Word document.  You can also put conditions within the workflow, one of mine was, if the Workflow was started by updating a list item, put “update” as part of the name of my word document.  If the workflow was started by creating a new list item, put “new” as part of the name of the document.  Be creative!! As always, if you have any questions, comments in sites or creative things you’ve done with Word documents, workflows, and metadata, feel free to leave a comment below.

 

References

XML mapping with Word & SharePoint - http://blogs.office.com/b/microsoft-word/archive/2007/01/18/xml-mapping-with-word-sharepoint.aspx

List fields + Workflow = controlled Word document - http://sharepoint-afterwork.com/2010/10/14/list-fields-workflow-controled-word-document/

Configure Word 2007 Content Control with empty Placeholder Text - http://www.moss2007.be/blogs/vandest/archive/2009/12/03/configure-word-2007-content-controls-with-empty-placeholder-text.aspx (This also work for Word 2010)

March 21
Audio Conferencing Solutions with Office 365

So, I signed up for an Office 365 account a few months back.  Lync offers a great solution for hosting online meetings.  However, one downside is there isn’t any options included with Office 365 for integrating a telephone audio conference with your online meeting/built in Lync audio.  They do offer an option though, the capabilities are there to integrated with a third-part phone conferencing vendor.  There are three vendors that provide the integrated service, PGi, InterCall and BT Conferencing.  I’ve spend the last two weeks signing up for, using, talking to (or trying to talk to) all three providers trying to find the one that best fits my needs.  For those of you that don’t want to read this lengthy post any further, I found InterCall’s pay-per-use plan to be the one for me as I don’t have consitant monthly usage and I’m the only one that’s using it (as opposed to a company with multiple users).  For those of you interested, my experiences with each of them (and why I chose InterCall) are outlined in the rest of this post.

First of all, some background on me.  As I said above, I was looking for a solution for just me.  I don’t have a team of individuals I needed to provide a solution for.  I also as mentioned above, I don’t necessarily use it every month.  It’s a sporadic thing where I only need the phone audio conference with Lync when I can’t use something like Skype or Integrated Lync audio due to participants being on the road, not having Lync or Skype (or being able to install it), etc..

PGi:

PGi probably would have been my first choice based purely on their customer service, knowledge of the solution and responsiveness.  The account manager I was assigned at PGi was very helpful and quick to answer all of my questions.  However, their plans just aren’t right for me at the time.  They offer several plans for audio conferencing.  However, one thing to be careful about is, not all of them actually integrate with Lync.  Their plan that would have fit me best was a $0.06/minute/user plan.  I simply pay for the time I use.  If I don’t use it one month, I pay nothing.  However, I found out this plan doesn’t integrate with Lync.  The plans they offer that integrate with Lync are: 300 minutes/month – $19/month; 500 minutes/month – $25/month; 1000 minutes/month – $39/month.  Not bad, but if I don’t know I’m going to use 300/month, I could end up spending a lot of money for nothing.  Roll over minutes or a per-per-use plan that integrates with Lync (Like InterCall) would be nice (hint, hint PGi)

BT Conferencing:

These guys were a big let down.  I have yet to actually hear from them via email, phone, anything.  I signed up for there $/minute/user plan (still have no idea what the actual cost is).  I’ve submitted a few requests to them online with no response.  I looked through their plans after I signed up, but nothing was very straight forward.  Overall, rather confusing and last or responsiveness was a big disappointment as well as not every publishing what the cost for their service is.  They rank last on my list.

InterCall:

They weren’t as knowledgeable on the Office 365 Lync integrated plans  as I had hoped.  I was able to talk to support on the phone, however they weren’t able to answer my questions or find anyone that could at the time (to be fair it was 6:20PM EDT).  The did give me the name/number for the sales rep in my area.  I left him a voicemail and haven’t heard back from him yet (It’s been 2 1/2 business days).  So he may have been able to answer my questions, I just haven’t talked to him yet.  However, they had the type of plan I was looking for that integrated with Lync.  Their pricing model is slightly different than PGi, but also offer three plans: Unlimited minutes, 10 participant max – $39/month; Unlimited minutes, 20 participant max – $49/month; Pay-As-You-Go, 125 participant max – $0.10/minute/user.  My opinion is this should hit a larger cross section of users than the current PGi plans do.

My Conclusions

As I said above ultimately I went with the pay-as-you-go plan from InterCall.  Sure an hour long phone call with 7 participants once a month will cost me more than the $39/month plan.  But if I only have one of these calls every other month I’m still saving money.  If I consistently use my audio conference every month (or several times every other month, etc) I’ll have to look at the minutes I use and re-evaluate between PGi and InterCall based on my actual usage.  My initial experience with InterCall so far is that their support staff is a bit under-trained on their Office 365/Lync integration options.  However, maybe the sales staff is better and the one in my area is super busy Smile.  The sign-up process was SIMPLE!  After not talking to Sales, I took the plunge and just signed up online.  The registration process took about 2 minutes and a credit card.  About 10-15 minutes after signing up a received an email with the phone numbers and pin.  I entered them into my Office 365 Lync settings and fired up a meeting.  I was able to launch the meeting from Lync and use my integrated computer audio.  I used my cell phone to dial into the conference (without entering the leader pin).  The call recognized both my cell phone and my computer as participants and I was able to have an audio conversation (yes, with myself) without any issue.  So, even though support wasn’t quite up to speed, the registration and configuration process was quick and simple and I didn’t need any assistance to get it up and going.  I did read about some people having issues if DNS wasn’t properly configured so I did double check and make sure all my DNS records were properly created.  The DNS settings aren’t anything special or different, just the standard DNS records (see the external domain name settings) Microsoft tells you to create when setting up Office 365.  Hopefully the support knowledge and sales responsiveness at InterCall improves as Office 365 becomes more popular.

If anyone has any questions, comments, feedback, issues, etc. I’m more than happy to talk to them.  Just leave a comment, contact me, or message me on twitter @SharePointBen

[Update before publishing] – I wrote this blog post on Tuesday evening and posted to twitter about my choice of InterCall.  This morning – Wednesday – InterCall did send me a message on twitter for a link to this post.  So InterCall is active on twitter, another plus for them.

March 02
A Day With Windows 8 (and SharePoint)

Hardware/Software

13” MacBook Pro, 120 SSD Hard Drive, 8 GB Ram

Software Installed:

[Update 3/5/2012] This has all been done on Windows 8 Consumer Preview, I haven’t had a chance to give this all a try on Windows 8 Server Beta yet.

Microsoft programs that seem to be working fine: Apps you would expect: Office 2010 Suite, Live Writer, Live Mesh, Expression Suite, SQL 2012 RC 0, Visual Studio 2010 Professional (with the Exception of MS SQL Server 2008 R2 Management Objects), Visual Studio 11 Beta

Third party programs working fine: Skype (I know, technically it’s MS now), Chrome, Safari, Firefox, Metrotwit, Trillian IM, CrashPlan, SnagIt 10, Quest PowerGUI, Notepad++, 1Password, iTunes, FileZilla, Logos Bible Software, WinRAR , CCleaner, DropBox.  I wanted to use Hyper-V for my VMs instead of VMWare Workstation, however my processor doesn’t support Hyper-V so I’m running VMWare Workstation 8.2, WinMerge, MakeMKV

Programs I had some trouble with: SharePoint 2010

SharePoint 2010

So, here is where I’m at, I figured to start I would just do the Stand Alone installation.  After manually installing all of the Pre-Reqs and switching all the defaults in IIS to .NET 2.0, the Stand Alone installation worked great! Central Admin was provisioned a site collection created, etc.  As with most things, it was too good to be true.  The first problem actually exists with Windows 7 to…UAC.  With UAC enabled it is impossible to access Services on Server in Central Admin or two create/modify/delete/etc your Web Applications.  Simple, turn of UAC.  Well, this prevents all your Apps, Market, etc from running.  So, if you hoping to try out the whole “metro experience” disable UAC keeps you from doing that.

Where does that leave us?  As for me, it leaves me with UAC enabled, a crippled install of SharePoint 2010, and remoting into my Server 2008 R2 SharePoint environment to do any serious SharePoint work.  Hopefully Microsoft will either figure out a way to get the functionality of SharePoint back with UAC enabled, or create a backdoor to use the metro interface/apps with UAC disabled.  If anyone else had any ideas, work around, or thoughts I would love to hear about them in the comments.  Now onto the rest of my experience with Windows 8…

[Update 3/5/2012] After some more playing, I’m able to do everything I need to in SharePoint by browsing to Central Admin, choosing to log in as a different user and logging into SharePoint as the built-in Administrator account (after enabling that account).  I also received some suggestions to right click IE and “Run as administrator”.  This hasn’t seem to work for me in the Windows 8 Customer Preivew, anybody else have feedback/experience getting it to work this way?

 

Bugs/Issues

Apps that aren’t working (from the App Store):

  • Reader (had to install Adobe Reader)
  • Maps
  • Solitaire
  • Pinball
  • Camera

Occasional crashes, seem to be when I leave the computer sitting (without any use).  Maybe some power saving feature that is trying to kick on and causing the crash? [Update 3/4/2012] This one I seemed to have resolved by disabling turning off the display.  I disabled turning of the display (I just have a screen saver come on) about 24 hours ago and haven’t had a freeze since then.

If you have multiple monitors and switch around the position of your primary monitor the icons may not automatically re-align properly. For instance, may laptop has much lower resolution that my 24” monitor.  When I first hooked up the 24”, the monitors were aligned on the top.  I went into my Display Settings Resolution and moved my laptop monitor to be bottom aligned.  The alignment was successful, bit the icons thought the monitors were still top aligned.  So, I only had about the lower 1/2 of my icons on my screen until I selected “Sort By –> Name” at which point in time they all sorted and arranged themselves properly with the new alignment.

Annoyances

As you install software (like Visual Studio, SQL) a TON of programs are added to your “Start Screen” that you may not want or need.  I’ve found I like to have my most commonly accessed program in the Tile and use search (keyboard shortcut Start-Q) to access the less frequent programs.  However, due to the number of programs added, it can be a little bit of work removing all the tiles I don’t want.  I think it would be nice to put nothing on by default, and as you open programs have the ability to pin them to the Task Bar, the Start Screen, or both

February 29
VMWare Workstation, Windows 8 Customer Preview, Windows 8 Server Beta

Just a quick FYI on installing any of the Windows 8 bits on VMWare Workstation.  I was trying to install both Server and Desktop OS in VMWare tonight and was getting the error: “couldn't read the <ProductKey> from unattend.xml”.  VMWare Workstation tries to use it’s own unattended install that is mounted to the VM in the form of a floppy disk image when you initially create the VM.  By going into your VM Settings after creating the machine and disconnecting the floppy drive from the VM the error will go away and you can successfully install Windows 8.

My install is still running so I’ll update this post with any other “gotchas” I encounter…

[Update]: The SVGA Driver in the VMWare tools causes issues.  So, when installing VMWare Tools, select the custom option and make the change NOT to install the SVGA drivers.  Don’t worry, the drivers built into Windows 8 Server work just fine.

[Update 2]: When installing Windows 8 Customer Preview you will be prompted for a product key (still haven’t seen a good explanation of why you need it using “physical media” (an attached ISO) vs. the Setup program.  But that beside the point.  Here is the key to use: (from Microsoft, it’s the 10th question under “Downloading and Installing”):

NF32V-Q9P3W-7DR7Y-JGWRW-JFCK8

February 28
Modify the Members Web Part with PowerShell

I’m sticking with PowerShell again for this blog post, this time it will be updating the members web part on a SharePoint page.  If you read my last post we were using PowerShell to provision the entire site.  This was another piece of the provisioning process.  The web part was already on the site template, but b/c the site hadn’t been provisioned yet, we could set the SharePoint group we wanted displayed in the Members web part, so we used this powershel script to do it:

   1:  $web = Get-SPWeb "http://intranet.sharepoint.com"
   2:  $page = $web.GetFile("default.aspx")
   3:  $wpm = $web.GetLimitedWebPartManager($page.Url, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
   4:  $wp = $wpm.WebParts[3]
   5:  $wp.DisplayType = [Microsoft.SharePoint.WebPartPages.MembersWebPartDisplayType]::GroupMembership
   6:  foreach($group in $web.Groups){
   7:    if($group.Name -eq "Group Name"){
   8:      $wp.MembershipGroupId = $group.ID
   9:    }
  10:  }
  11:  $wpm.SaveChanges($wp)

 

Hope this helps out and feel free to leave comments about what other tasks you would like to see done with PowerShell.

January 20
Using PowerShell to “hide” folders in a SharePoint List View

So here it is, my first post of 2012.  I’ve been doing a lot with PowerShell and SharePoint lately and really been enjoying it.  However, this one tasks had be stumped for a while.  Within a SharePoint view, under the “Folders” section you have the ability to specify either “Show items inside folders” or “Show all items without folders”.  The view works great if you want to offer your users a view to see all content without that content being buried within folders.

Our problem came in that we were provisioning the entire site (including views) using PowerShell.  So, how to set this in via PowerShell.  I couldn’t find ANY properties relating to folders for a List view.  After a few hours and some digging I found that it done by setting the view scope to recursive.  It actually does make some sense when you think about it.  So, here is the PowerShell needed to “hide” folders within your SharePoint list view:

$web = Get-SPWeb "http://intranet.sharepoint.com"
$doclib = $web.Lists["Shared Documents"]
$view = $doclib.Views["All Documents"]
$view.Scope = [Microsoft.SharePoint.SPViewScope]::Recursive
$view.Update()
December 23
Merry Christmas and a Happy New Year!!

Merry Christmas and a Happy New Year to everyone!  I hope and trust everyone has had a blessed year, despite any hardships that may have transpired in the last 12 months.  As for me, I’ve had a wonderful year of consulting as well as some great times personally with my wife and family.  This year has also brought with it some trials and difficult decisions.

Over this last year my wife and I have had the great opportunity of being able to spend a week up in Michigan camping with my family as well as going on a Disney Cruise with my wife’s family in June.  Additionally in July we were able to get away for a few nights to St. Simons Island, GA to celebrate our second anniversary.  This Christmas we have also been able to spend additional time with family in Michigan and out in Colorado.

As for work life, a couple of weeks ago I made the difficult decision of resigning from my position as a Sr. SharePoint Architect with EPC Group.  It has been a privilege to work with several different individuals and clients over the past year and I have continued to hone my skills as a SharePoint consultant and increase my SharePoint knowledge as a result of working with these individuals and clients.

For what’s next?  I have a few things brewing so for now, all I’ll say is stay tuned to my blog/Twitter/Facebook feeds for additional updates coming sometime in 2012.

I hope everyone has a Merry Christmas and in all of the celebrations, remembers what we are really celebrating this time of year (and it’s not Santa). 

      “For to us a child is born,
      to us a son is given;
                  and the government shall be upon his shoulder,
      and his name shall be called
                  Wonderful Counselor, Mighty God,
      Everlasting Father, Prince of Peace.” -
The Holy Bible: English Standard Version. 2001 (Is 9:6).

November 22
Macbook Pro + Hyper-V = Issues

So, recently I decided to install Windows Server 2008 R2 on my MBP (late 2010 model) rather than using Mac OS with VMWare Fusion.  I won’t go into all the details around this decision, however I did encounter one big surprise.  This one being a nightmare with Hyper-V.  I liked the idea of being able to run Hyper-V for VM’s on my MBP, specifically Windows XP for using VPN with some clients.  Also, I could easily manage and connect to my Hyper-V server running at home.

After getting everything all set and spinning up Hyper-V with a Windows XP VM, my laptop was dog slow!! I have an SSD hard drive, 8 GB of RAM and a dual core proc…no way everything should be this slow.  My video was also doing REALLY weird things, this I chalked up to the fact that I was using my laptop display and two external monitors (making use of the display port as well as an external USB “video card”).

So, what did I do? Some searching for what could be the issue.  I started seeing some posts about issues with Hyper-V and certain nVidia video cards in laptops causing weird behavior with Hyper-V.  Hm….slow computer and video issues??  So, I uninstalled the Hyper-V role and success!! My laptop runs much smoother AND, as a bonus, my video now is much better.  I went back to VMWare and am now using Workstation 8 on my MBP with very good success and just using the Hyper-V management tools to connect to my server without any issues.

November 14
Uploading Large Files to SharePoint 2010 Using the Client Object Model

Recently I've been working on a solution that required using the client object model to upload large files to SharePoint. Not having a development background, I started searching for the best way to accomplish this task. I came across this helpful blog post that gave me a good start. I followed all the recommendations in the post and went with the HTTP DAV method mentioned second in the post.

However, I was uploading batches of files and getting a sporadic error stating:

System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

After hours searching and trying different attempts at fixing it without any progress I decide to switch back and use the client library batch mechanism mentioned first in the article. This worked much more consistently, but I was getting the "The remote server returned an error: (400) Bad Request." That was mentioned. I figured it was the easy fix of increasing the message size, however, this didn't fix my bad request error. Back to searching and I ran across this MSDN KB article about the issue. Come to find out there is are actually two lines of code not mentioned in the first link I referenced that were important to get the solution working.

  1. This one was mentioned further down in the comments, but it is to have clientContext.Load(doclib)
  2. This one was only in the second KB article and it was to have clientContext.Load(web)

After adding these two lines of code to my solution all files in the batch were consistently uploading via the object without any problems.

This may be common knowledge to some developers, but hopefully it can be helpful to some of you aspiring SharePoint developers out there.

1 - 10Next
​​