Why Community? Some just don’t get it…

More and more my presentations are gearing towards talking about community. My latest one, "Building a SharePoint Community", is a step-by-step walk through of how EndUserSharePoint.com became a central community around SharePoint End Users and what people can do to develop their own communities.

The dilemma is this: Marketing people get it right away… I mean almost IMMEDIATELY. However, I’m having difficulty convincing sales people of the value of becoming part of a community. We’re not just talking about SharePoint here. Pick your target. Think of your own sales staff.

We all have the same problem when it comes to sales. We’ve got to get a HUGE pipeline of potential clients going through the pipe, trying to close a certain percentage of deals to get everything to work. I understand that. I know the constant pressure sales are under to "A.B.C. – Always Be Closing!". But there’s something missing in the process, and that something is relationship building for the long run.

Help me out here. Why have you become part of the EndUserSharePoint.com community? Why do you participate in the site? Why are you part of the SharePoint Community in general? Help me frame a message to the sales people of all SharePoint companies and vendors: THIS is why we particiapte in community. What is the real value for a sales team to become part of an existing community?

To me, it’s almost a rhetorical question, but more and more I see that the community message isn’t clear and doesn’t resonate with the sales audience. I want to make a presentation on "Why Community Matters: A Sales Perspective". I’ll make a recording as soon as I get clear on the message and make it available here on the site for you to download.

Your input is greatly appreciated.

How clear is your product documentation? Not as clear as it could be.

Giving Instructions - How to Pack Up

I went to "Family Morning" at my 5 year old daughter’s school yesterday. I walked around the room, looking at the work she has done, reading the story she is working on and getting to know her new friends. Then I saw the chart that showed her how to pack up and it stopped me dead in my tracks.

This is the ULTIMATE user’s guide poster. It is 2 feet by 3 feet. There is nothing challenging about it. Each step is self explanatory, down to having a little picture to clarify the step. I almost started screaming out loud! This is AWESOME!

Please tell me that you’ve got a pre-schooler on your staff that oversees your documentation creation. I would pay big time to have documentation for software this simple and creative.

Granted, software is a little more complex, but for the End User, does it really have to be?

I like this… a lot!

WP Tabify: Transform a SharePoint Web Part Zone into Tabs

Guest Author: Kyle Schaeffer
KyleSchaeffer.com

I do quite a bit of design and implementation on the SharePoint platform. Today, I created a very handy little script that I think might be something worth sharing. I don’t often post anything so specific on my blog, but I found this to be extremely useful, and I hope you do too.

What is it?

This all started with a great idea from the mind of Matthew Koon. If you’re not familiar with SharePoint, one thing you can do in the platform is place web parts on a page, which are akin to sidebar widgets in WordPress or other CMS platforms. Web parts have a lot of nifty drag-and-drop functionality, but the appearance of them is pretty much limited to what you can do with a bit of CSS and maybe some background images. The script that I created transforms a particular “web part zone,” which contains individual web parts, into a jQuery UI tab control. For each web part in the zone, you see an interactive “tab” instead of a boring static box. The contents of each tab is the contents of the web part, itself.

What does it do?

When you’re editing a page, you’ll see this:

When you publish the page, you’ll see this:

1. Attach Required Scripts

You’ll need both jQuery 1.4.2 and jQuery UI 1.8.5 (or later).

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script>

2. Attach the Script

Paste this into an attached JavaScript file:

(function($){
  $.fn.wpTabify = function(){
    if($('.ms-WPAddButton').size() == 0){
      return this.each(function(i){
        var tabList = $('<ul class="wpt-ui-tabs-nav"/>');
        var panels = $('<div class="wpt-ui-tabs-wrapper"/>');
        $(this).find('.s4-wpTopTable,td[id^="MSOZoneCell_"] > table').each(function(j){
          $(tabList).append('<li><a href="#ui-tab-panel' + i + j + '">' + $(this).find('h3.ms-WPTitle').text() + '</a></li>');
          var thisPanel = $('<div id="ui-tab-panel' + i + j + '" class="wpt-ui-tabs-panel"/>');
          var panelContents = $(this).detach();
          $(thisPanel).append($(panelContents).find('.ms-WPBody').html());
          $(panels).append(thisPanel);
        });
        if($(tabList).find('li').size() > 0){
          $(this).prepend(panels);
          $(this).prepend(tabList);
          $(this).tabs();
        }
      });
    }
    else{
      return false;
    }
  };
})(jQuery);

3. Wrap Your Web Part Zone

In your custom page layout, place a <div/> tag around a web part zone, and give it a class name or ID of your choosing.

<div class="my-web-part-tabs">
  <WebPartPages:WebPartZone id="zone1" runat="server" title="Tabs Zone"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
</div>

4. Run the Script

All that’s left is to run the jQuery plug-in, like so:

$(document).ready(function(){
  $('.my-web-part-tabs').wpTabify();
});

5. Add Some Style (Optional)

You may choose to add a bit of style to your newly tabified web parts (this is not specific to this plug-in, these are just some generic jQuery tabs styles):

.ui-tabs-nav {
    margin: 0;
    padding: 0;
}
.ui-tabs-nav li {
  list-style: none;
  margin: 0 1px 0 0;
  padding: 0;
  float: left;
}
.ui-tabs-nav a {
  position: relative;
  top: 1px;
  display: block;
  padding: 10px 8px;
  border: solid #e1e0dc;
  border-width: 1px 1px 0 1px;
  background: #d6d6d6;
  color: #999;
  text-decoration: none;
  -webkit-border-top-left-radius: 5px;
  -webkit-border-top-right-radius: 5px;
  -moz-border-radius-topleft: 5px;
  -moz-border-radius-topright: 5px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}
.ui-tabs-nav li.ui-tabs-selected a {
  color: #c70d37;
  background: #fff;
}
.ui-tabs-panel {
  clear: both;
  padding: 20px;
  background: #fff;
  border: 1px solid #e1e0dc;
}
.ui-tabs-hide {
  display: none;
}

Compatibility

This has been tested in SharePoint 2007 and SharePoint 2010. Make sure to set your web part chrome to anything other than None, as my script relies on the web part title to display the tab title. Please let me know if you have any issues, as I will continue to update the script as needed. Good luck, and happy tabbing!

Guest Author: Kyle Schaeffer
KyleSchaeffer.com

Kyle is a designer, speaker, and blogger living in Williamsburg, Virginia.  He is a Senior SharePoint Consultant at SusQtech, where he has years of experience creating and implementing user experiences on the SharePoint platform.  An advocate of simple and elegant web design, Kyle shares lessons learned and best practices on his blog, KyleSchaeffer.com.

[tweet]

How clear is your message? Not very, I’m afraid.

How Clear is Your Message?
Look at the picture above and tell me what this company sells. 99 times out of 100 people will say "Fish", and they will be correct.

I think about this a lot. I speak at many SharePoint events around the world, seeing the same SharePoint vendors, many who I have come to consider colleagues. The problem is, I still can’t tell you what their product is. I know the name of their company. I know the people who work for the company. But if you paid me $1,000,000.00, I couldn’t tell you the name of their product and what it does.

Why is this? How can it be that I have seen something dozens of times and still can’t answer a simple question: What do they do.

I attribute this to clarity of message. If I am standing in front of a company booth at an event like The Experts Conference, Best Practices Conference or SPTechCon and I have to ask what you do, it’s a losing game for both of us.

Clarity of message: What do you do? I shouldn’t have to ask. If the company has spent thousands of dollars for a booth, more money for design of the booth, and then is paying someone to staff the booth, there is a total disconnect if I have to ask, "So, what do you do?"

My main emphasis at the moment is as a SharePoint Evangelist, spreading the SharePoint goodness to as many people as possible. If you’d like people to talk about your product, you need to give them something right up front that is clear, consise and unambiguous. What do you do? Please don’t make me ask. Clarify your message before I talk to you and we can have a very productive conversation.

Just my two cents for the SharePoint companies that have good products and can’t understand why no one is talking to them or about them. Look at your message. Is it as clear as the "Meat Without Feet" brand?

SharePoint Governance and Information Architecture Master Class in London

Paul CulmseeGovernance is one of those things people talk about all the time but can’t figure out how to get started. Paul Culmsee and Andrew Woodward from 21Apps are planning to do something about that.

They have created a new workshop: SharePoint Governance and Information Architecture Master Class.

Paul and Andrew are seasoned veterans who will walk you through the minefields and get you started on implementing a governance program. After reading the complete details, use this promotion code (EUSP) to get a special EUSP discount for the two day session.

This is live, in person training in London, November 22 – 23rd, 2010. Hope to see you there. — Mark

Agenda

SharePoint Governance f-Laws 1-17    
Why users don’t know what they want    
The danger of the platitude    
Why IT doesn’t get it    
The adaptive challenge – how to govern SharePoint for the hidden organisation    
The true forces of organisational chaos    
Wicked problems and how to spot them    
The myth of best practices and how to determine when a “practice” is really best
The Shared Understanding Toolkit – part 1:    
The blind spot – “What and why” governance Tools
The Shared Understanding Toolkit – part 2:    
“Who and How” governance Tools
Trends in the information landscape and Information Architecture lessons learned
The four facets of collaboration
Key SharePoint challenges for information architecture
Putting it all together: From vision to execution

SPTechCon 2010 Boston – Images, Tweet Steam, Live Blogging Archives and Resource Links

SPTechCon Boston was a jam packed three days of sessions and getting together with colleagues from the SharePoint Community. I took almost two hundred pictures during the event, so have a look to see if you recognize anyone.

In addition to the images, we had a constant stream of twitter feeds and live blogging going on, all of which is embedded below in the panels below.

Other sites are publishing articles, post SPTechCon. Here’s the list I found in my twitter stream. If you know of others, add them in the comments and I’ll update over the next week.

EUSP Twitter Tracker for SPTechCon 2010 Boston
SPTechCon – Live Tweet Stream
SPTechCon Boston – SharePoint Admin
SPTechCon Boston – SharePoint Developer
SPTechCon Boston – SharePoint End User
SPTechCon Boston – SharePoint Power User

I get by with a little help from jQuery and SPServices…

Mark RackleyGuest Author: Mark Rackley
The SharePoint Hillbilly

So.. unless you’ve been living under a rock (or in Arkansas) you have no doubt read a billion blogs (well, maybe not a billion) about using jQuery in SharePoint.  You’ve also probably read several more on the great tool at CodePlex called SPServices created by Mr. Marc Anderson. Maybe you’ve played with both? Maybe you’ve grappled with trying to find a real world scenario for when you would use them?

Well.. I’ve been doing a lot lately with SPServices in SharePoint because I’m starting to deal with clients that do not allow any managed code on their servers or we have to go through an arduous process to get managed code approved.  I’ve got a couple of pretty interesting SPServices and jQuery blogs up my sleeve, but I wanted to write a more simple easy to follow blog first so that you can get an introduction to SPServices if you are new to it.

So? What are we going to do?

Think back to one of my earlier blog posts on creating a Parent/Child list relationship:

Creating a SharePoint List Parent/Child Relationship – VIDEO REMIX

In this blog I created a DataViewWebPart to display time entries associated with an issue:

How about we add some functionality so that a user can delete one of the time entries from this page without having to go to the EditForm for the Time entry or use the drop down menu? How about we add a “delete” button to each row that a user can click to delete that row? Yes.. I know… not a great reason to do this in this scenario. I don’t want to see your whiny comments saying I should have done it another the way.  The point of this blog is to introduce you to SPServices.. got it? If you don’t like it, let me show you a really funny kitten video by clicking HERE

Are they gone yet? good… okay… so… let’s get started.

A few comments about SPServices and jQuery

So… first thing you need to do is download the jQuery library and the SPServices library.

  • SPServices – Click the download link
  • jQuery 1.4.1 – The current release is 1.4.2, but I’m using 1.4.1 in all my examples.

Next you will need to put these javascript files some place that you can access them in SharePoint. DO NOT reference them from some 3rd party web site. It will affect your performance and if their site goes down for any reason then your functionality is broken. You have two options for putting these on your SharePoint farm, each come with a positive and a negative:

Place files in a document library

You can put your files in a document library that all your users will have access too.  This has the benefit of easily being able to upload new version of a javascript file or quickly tweak existing one.  The downside is that you will take a slight performance hit from storing them in the content database.

Deploy files to the file system

Yes.. I said DEPLOY (don’t manually copy).  By storing your javascript files on the file system you get the benefit of improved performance, but you lose the flexibility of being able to upgrade and modify the files as easily as if they were in a document library.

Don’t know how to deploy? Well, now you can take advantage of one of my other blog posts:

Creating SharePoint Solution Packages! So easy an Admin can do it!

Typically, especially for development I just place my javascript files in a document library.  So, for the sake of this demo, I’ll upload them to a document library called scripts:

A quick caveat about jQuery

Yes… jQuery is awesome, and yes it will help you do some really cool stuff that you wouldn’t be able to do without managed code,but please keep in mind that jQuery and all javascript is executed on the CLIENT’s computer, not the server. This means you cannot guarantee the performance of your javascript on someone else’s crappy old computer. If you abuse javascript, your users’s perforamnce and experience will suffer. Use it wisely, use minimized files whenever possible, and just be aware of this please.

Okay… what’s next?

Okay… next thing we need to do is drop a Content Edit Web Part AT THE BOTTOM of our page. Please note, that I have more than once failed to place the CEWP at the bottom of the page which will prevent you from being able to call your javascript functions. That’s a fun one to debug the first time you run into it.

Now let’s write our jQuery that will delete a time entry. We will need to know the ID of the time entry in order to delete it.  Let’s not worry about how we’re going to get that right now. Let’s just hard code something for testing.  So, using SPServices our jQuery will look like the following:

//load our scripts
<SCRIPT type=text/javascript src="../../scripts/jquery-1.4.1.min.js"></SCRIPT>
<SCRIPT type=text/javascript src="../../scripts/jquery.SPServices-0.5.6.js"></SCRIPT>
<SCRIPT type=text/javascript>
    
function DeleteTimeEntry(timeEntryID)
{

//Set cursor to hourglass
document.body.style.cursor = "wait";

//we will be executing the SharePoint WebService "UpdateListItems" with the Command "Delete" to delete
//a list entry from the list “Time”  

     $().SPServices({
      operation: "UpdateListItems",
      async: false,
      listName: "Time",
      updates: "<Batch OnError='Continue' PreCalc='TRUE'>" +
                "<Method ID='1' Cmd='Delete'>" +
                    "<Field Name='ID'>" + timeEntryID +  "</Field>" +
                "</Method>" +
            "</Batch>",
        completefunc: function (xData, Status) {
                                                //check for errors here
                        //reload the page after the deletion has occurred
            window.location = window.location;
        }    
     });

 //Turn hourglass off
  document.body.style.cursor = "default";
 }
 
 </SCRIPT>

Pretty simple? It’s basically just one call.  We pass in the ID for the Time entry (timeEntryID) we want to delete, and SPServices executes the UpdateListItems Web Service method to delete that entry from the list called “Time”, and then we reload the page. So, place the above script in your CEWP by either Clicking on the “Source Editor” button from the CEWP’s property pane or upload this script to your scripts document library and reference it in the “Content Link” of your CEWP.  Again, for development purposes I usually just copy and paste it into the CEWP:

You can actually test this code by creating an HTML button at the bottom of your script and passing in a hard coded Time Entry ID that you know exists. For instance, I know that for my screen shot up there “Title 3” has an ID of 6.  So my test button would look like:

<input type=button value="Delete a Time Entry" onclick="javascript:DeleteTimeEntry('6')">

Before button click:

After button click:

By the way, if you get the error “Object Expected” it generally means that the path to your javascript files is not correct and they did not get loaded.

Okay.. that’s all fine and dandy, but what we really want is to put a delete button on each row of the Time list that will automatically pass in the correct Time entry ID.  To accomplish this we are going to tweak our DVWP is SharePoint Designer. So, go ahead and open up the site in SPD.

Modify DVWP

Okay.. let’s add a column for our button to the Time list DVWP. If you haven’t done so already, make your DVWP show sample data so that it’s easier to work with:

Now click on the word “Title” in the DVWP, then Right click on “Title” and select “Insert->Column to the Left”

This will create an empty column for us to put our delete button in:

Next click on one of the empty cells in your new column and SPD should bring you to the corresponding location in your code for that cell. I wish SharePoint was always consistent, but it’s not.  In my DVWP the code looked like:

 <td class="ms-vb">
                <xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text>
            </td>

Go ahead and delete that whole line between the <td> and </td> we don’t want that.  We want to put a button there that calls our javascript.  It will look something like:

           <td class="ms-vb">
                <input type="button" value="Delete" onclick="javascript:DeleteTimeEntry('6');" />
            </td>

However we need to pass in the ID of Time entry and not the hard coded “6” from our test button.  This turns out to be super easy to do, because we are in our DVWP we can specify the ID for the row we are on by using “{@ID}”.  this is very similar to what we did in the Parent/Child post referenced above in case you need step by step instructions on how to do this.  Anyway, the resulting cell looks like:

 <td class="ms-vb">
                <input type="button" value="Delete" onclick="javascript:DeleteTimeEntry('{@ID}');" />
            </td>

And that’s it! We’re done! Simply load your page in SharePoint and click one of the delete buttons. The page should reload fairly quickly with the corresponding Time entry deleted":

By the way, don’t forget to remove your test button at the bottom of the page.

So there you go! Not exactly rocket science, but hopefully a fairly non-threatening introduction to SPServices and jQuery in SharePoint.

Please stay tuned for more, I cannot and will not promise that it will not get much more hairy from here.

As always, let me know if I need to elaborate on anything. If you find yourself completely lost, go back and view: Creating a SharePoint List Parent/Child Relationship – VIDEO REMIX then come back here and everything should make much more sense.

Cheers!

Mark RackleyGuest Author: Mark Rackley
The SharePoint Hillbilly

Mark has been developing software applications for over 15 years filling the roles of Project Manager, Business Analyst, Lead Developer, and Software Architect. He has been involved in projects for such companies as Dell, Motorola, Intel and Agilent Technologies. He has worked in large corporate environments, small software start-ups, and as a consultant. Mark currently works for Juniper Strategy, LLC as a Solutions Architect making key SharePoint architecture and development decisions as well as bringing the appropriate SharePoint Best Practices to his clients and customers.

Mark’s goal as a speaker, blogger, and author is to help every new architect and developer avoid the frustrations and brick walls he ran into while learning SharePoint.

Blog:  http://www.sharepointhillbilly.com
Email: mrackley@gmail.com
Twitter: http://www.twitter.com/mrackley

[tweet]

SharePoint: Integrate ASP.net controls with Forms – Part 4: Trimming Drop Down List results using CAML

Guest Author: Matt Bramer
http://mattbramer.blogspot.com

ACK!!! CODE!!!

I’ve been writing these posts by using a *real* no code approach, sort of. I have a very different view of what no code means, but that’s a different story altogether. However, this article I’d like to have you peer into the dark-side. I know all too well, viewing code can make your eyes bug out, but I do feel it’s necessary at some point to learn. I’ve taught myself most of the programming skills I possess today, so I know you can too. I understand trying to learn these languages on your own can be a real burden, so if you don’t understand how it works, just try it anyway. The worst that will happen is the solution will not work. There’s no shame in trying and if it does work, then you can impress your boss!

DVWP & CAML

We should probably look at how these two are related. CAML (Collaborative Application Markup Language) queries are the instructions within the DVWP or SPDatasource that controls what data is retrieved from the database. The CAML query is hidden from you unless you know what you are looking for. Here’s a sample line of code that contains a CAML query:

<SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UseInternalName="True" ID="dataformwebpart2">

Within this line of code is a SelectCommand. This command combined with the CAML: "&lt;View&gt;&lt;/View&gt;" will control what information is displayed to us in the browser. I wont get into all of the details here, but I thought it would be important to show you what’s happening under the hood.

Okay CAML, I sort of get it. Now what?

What we want to do is trim the results of the Drop Down List to only show what items have been created by the currently logged in user. To do that, we need to update the SelectCommand for our SPDatasource with our own CAML. What I like to do is search for the SelectCommand by clicking into the Code View window, and then clicking on Edit, Find. Remember to click into the code view at the top of the page.


If you’ve followed along from Step 1, then the first SelectCommand that you’ll find is the one we’ll need to update. The code should look similar to this:

<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;/View&gt;" id="spdatasource1">
	<SelectParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</SelectParameters>
	<DeleteParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</DeleteParameters>
	<UpdateParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</UpdateParameters>
	<InsertParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</InsertParameters>
</SharePoint:SPDataSource>

We’ll need to only update the SelectCommand with our custom CAML query:

&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef
Name=&quot;Author&quot;/&gt;&lt;Value
Type=&quot;Integer&quot;&gt;&lt;UserID/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;>

The final result should look similar to this:

<SharePoint:SPDataSource runat="server" DataSourceMode="List" UseInternalName="true" selectcommand="&lt;View&gt;&lt;Query&gt;&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;Author&quot;/&gt;&lt;Value Type=&quot;Integer&quot;&gt;&lt;UserID/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;&lt;/Query&gt;&lt;/View&gt;" id="spdatasource1">
	<SelectParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</SelectParameters>
	<DeleteParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</DeleteParameters>
	<UpdateParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</UpdateParameters>
	<InsertParameters>
		<asp:Parameter Name="ListID" DefaultValue="{D3CB17ED-B351-4463-94E5-9C4863A3CEA3}"/>
	</InsertParameters>
</SharePoint:SPDataSource>

Now would be a good time to save your work! When we view the page now, all you will see in the Drop Down is the documents you’ve created. When a different user views this page, the same will hold true. They’ll only view the documents that they’ve created. With this tiny piece of CAML, you can see how easy it can be to change the interaction within the page. Don’t lock yourself into a box either, CAML will allow you to filter anything within the list. So, if I wanted to, I could change the CAML to retrieve only the documents I’ve created and also if the DocCategory equals: I’ve been slacking. Try to be as creative as you can, I think you’ll be impressed with what you can do with this.

CAML is tough to learn. Is there an easier way?

Absolutely! There are several ways of learning CAML. First you *could* decipher the official documentation for CAML on MSDN. Or you can try out these 2 different approaches. First up is to crack open your Document Library and create a view. Let’s filter this library for all Docs created by [Me] AND when the DocCategory equals: I’ve been slacking.

Once you’ve created this view, you’ll notice in SPD, the view appears as an .aspx page. If it doesn’t, refresh SPD by pressing F5 and it’ll be there.

We need to open this page and convert this Web Part into an XSLT View. I do that by right clicking on the Web Part and selecting; you guessed it: Convert To XSLT Data View. Once this has been converted, we can search through the code for our SelectCommand. Yep, we just used SharePoint Designer as a CAML code generator. Pretty cool eh? I use this approach when I know my filters are going to be more complex than normal. I can take it as far as I can before I have to tweak it manually. So that’s one way to start learning CAML.

Next up is to use the free CAML Builders that are on the internet. These two are the best I’ve found: U2U CAML Query Builder & Stramit CAML Viewer. These work a little differently than the first method, but you can build your code all the same. I suggest downloading both of them and experimenting with the capabilities of both. I’m still learning the nuances of CAML myself, so I always use these different methods to generate my code. Once you’ve generated the code, learning the language will take you to the next level and allow you to produce some very cool results.

You’ll also notice when you use these two tools, the code is in this format:

<View>
   <Query>
      <Where>
         <Eq>
            <FieldRef Name="Author"/>
            <Value Type="Integer">
               <UserID/>
            </Value>
         </Eq>
      </Where>
   </Query>
</View>

You’ll need to escape this code in order to work well with your DVWP or SPDatasource. I’ve wrote a PowerShell script to do just that or you can use the XML Escape Tool. Both of these will convert all of the characters that aren’t allowed in the SelectCommand into characters that are allowed. I’ve listed them below for you:


Original Character
Escaped

&apos;

&quot;

&

&amp;

&lt;

&gt;

Note: The CAML query cannot contain any white space. The code must also be in one continuous line. It sounds like a lot of steps, but once you get the hang of it, you’ll be flying through this stuff. Post a comment and let me know which method you like the best.

What’s next?

This article wasn’t supposed to be this long, but in the end, I felt it was necessary. Hopefully it was clear enough to follow. There’s still one more tweak I’d like to show you. With the next article, I’ll show you how to force a selection within the Drop Down List. This will make the page a bit more user friendly, so that’s always worth the extra effort. I promise, we’ll jump out of code view and start clicking around more: Screenshots and all… Are you still interested?

Guest Author: Matt Bramer
http://mattbramer.blogspot.com

Matt Bramer works as a Systems Admin in the construction industry.  He has been working with Search Server Express since 2008 and frequently blogs about his findings at http://mattbramer.blogspot.com.  Matt often posts to Stump the Panel and likes to tweet about his IT projects on Twitter (@iOnline247).

[tweet]

Convert a standard SharePoint lookup column to a full blown cross site lookup using javascript only

Guest Author: Alexander Bautz
SharePoint JavaScripts

I have updated the tool described in this article with some new functionality.

The functionality I will describe here is the ability to convert a standard SharePoint lookup column to a cross site lookup column using javascript/jquery only!

Download the script from the above referred article. Create a Lookup column in your list and have it point to the actual list it is created from (it is in fact not relevant what list you point it towards). Load the script from the above described article and select your list:

Images

Select the list

Modify the web and list association and hit “Save”:

NOTE: The web selector is only available for site collection administrators.

If you are a non site collection administrator, you may change the list association, but not the web association.

This method requires NO modification to the field schema and is fully compatible with Data sheet view etc.

I have not had the chance to test it in SharePoint 2010 yet, but I can see no reason why it should not work.

Alexander

Guest Author: Alexander Bautz
SharePoint JavaScripts

Alexander Bautz is a SharePoint consultant/developer (mainly JavaScript/jQuery solution) living in Norway. Alexander spends a lot of his spare time blogging on the same topics. His focus area is "end user customizations" with no (or as little as possible) server side code.

[tweet]