Posts

Showing posts with the label SharePoint 2010

Using JQuery to Tweak Editform.aspx

For smaller changes to your Editform.aspx you may want to avoid doing a solution deployment that contains a custom content type feature with a custom EditForm.aspx.  This is a quick workaround.  It's pretty much the same as we used to to in MOSS with only minor changes to the way you get to the form. I did this in IE, but it's probably similar in other browsers: Place an html document containing some JavaScript/Jquery into a document library on your list's site.  (Try just putting this for initial testing: <script type="text/javascript">alert('hello world');</script>) Navigate to the list whose editform.aspx you want to change Right click on any item's link to it's display form and choose 'open in new tab' Go to the newly opened tab and click the 'Edit Item' button  to open the item in the editform.aspx append &ToolPageView=2 to the url Add a Content Editor Web Part and point it to your document from step 1...

Opening an Infopath form library template from Infopath in a link

I've found a lot of bad info on how to do this and it's not well documented so hopefully this helps someone: first create a JavaScript function so that your links aren't super long: <script type="text/javascript">             function OpenForm(absSiteUrl, siteRelFormUrl, siteRelSaveUrl)             {                         var formUrl = absSiteUrl + siteRelFormUrl;                         var saveUrl = absSiteUrl + siteRelSaveUrl;                         var formSvcUrl = absSiteUrl + "_layouts/FormServer.aspx?XsnLocation=" + formUrl;    ...

People Search from MySite returns 404

If you have MySites and a Search Center running in your farm, you may have overlooked a not-so-obvious configuration setting. When setting up MySites for a User Profile service application, your Search Center URL must point to the "Pages" folder where the Search Center publishing pages are located instead of the Search Center web URL. Otherwise, a People Search from a MySite will forward the request to to http://[searchcenter]/PeopleResults.aspx?k=searchquery (which doesn't exist) instead of http://[searchcenter]/PeopleResults.aspx?k=searchquery which is where the PeopleResults.aspx page is actually located. TLDR: Use http://[searchcenter] /Pages/ for your Search Center url in UPA MySite Settings.

Including a JS file for a custom ribbon control CommandUIHandler without using a ScriptLink CustomAction or Custom Page Components

I've been struggling lately with the proposed solutions for including the javascript for CommandUIHandler's CommandAction and EnabledScript attributes.  Thus far I have only seen the following examples: JavaScript directly into the attributes (messy), Including a ScriptLink command action (bad because then the script file is included in every page where the feature is activated causing bloated pages) Creating a page component (overcomplicated) Instead of all this, I created a pattern which loads the js file on the fly with javascript and keeps your ribbon development more compact (note I have JQuery loaded in the master page, if you don't have this then you'll have to either load jquery dynamically or reference the elements without JQuery): <commanduihandler    CommandAction="javascript:                              ...

PowerShell code for looking up document properties

If you want to use the SPWeb.Files.Add() method that allows you to pass in a HashTable of metadata for the document, you will need to use the internal name of the metadata field, not the display name.   Here's a PowerShell script to get that for you quickly: $web = Get-SPWeb http://intranet.sharepointdev.com $list = $web.Lists["Shared Documents"] foreach($item in $list.Items) {     $file = $item.File     #output all the SPFile property names     foreach($key in $file.Properties.Keys)     {         write-host("File Key: " + $key)     }         #output the associated item's fields     foreach($field in $item.Fields)     {         write-host("Item Field: " + $field.InternalName)     }     break; }

Setting up a SharePoint 2010 Developer VM using VirtualBox

I spent a few hours this weekend creating a SharePoint 2010 Developer environment using the RTM. For now, I'm approaching my dev build the same way I had my MOSS 2007 VM set up - a standalone MOSS install with Visual Studio installed. Because I wanted to use a 64bit guest OS (64bit Server 2008), I decided to use VirtualBox as my VM solution, if you want to use VirtualBox, you can get it here . I should note that when I set up my VirtualBox VM I gave it 20GB of hard drive space which was not enough so I had to expand the drive ( described later orange text ). I'd suggest going to 40 or more if you can because Windows,SP2010, SQL, and Visual Studio take up about 18GB (and setting it up right the first time will save you from having to do this . Once I had Server 2008 installed on a VirtualBox VM I downloaded the RTM version of SharePoint from MSDN. I then attached the SharePoint 2010 .iso file to my VM, opened the mounted SharePoint 2010 image and ran the Prerequisite ...

How to: Set up your SharePoint 2010 development environment

http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx

SharePoint 2010 Beta Available on Technet now!

2 days early. https://technet.microsoft.com/en-us/subscriptions/securedownloads/default.aspx?pv=42%3a393