Archive

Archive for the ‘SharePoint’ Category

Add a column to a Enterprise Wiki Page Layout in SharePoint 2010

March 21, 2013 Leave a comment

After you have create your Enterprise Wiki, you might have a need to add additional fields. For instance, your client might want a summary field on the wiki page. In this case you will need to modify the Enterprise Wiki Page Layout. The video shows you how. Keep in mind that it’s not always a good idea to modify the Enterprise Wiki Page Layout. Instead it might be better to make a copy of the Enterprise Wiki Page Layout and modify that instead. If anything goes wrong with the copy and can simply start over.

Other helpful links:
Modifying the Page Layout for Enterprise Wiki Pages in SharePoint 2010
How to Create WIKI Custom Page Layout & Rich Text Control inside Your Page Layout?

SharePoint 2013 web services: View JSON results via Firefox

March 20, 2013 Leave a comment

If you are working with SharePoint Designer 2013 workflow action “Call HTTP Web Service” then you might know that return results in JSON via accept header is important. But what if you want to view the JSON results in the browser? It would be helpful to see the data you are about to consume. The video below will demonstrate how to do that in Firefox. I don’t know how it is done in Chrome or IE (The video has no audio)

Other helpful links:

The Accept Header

SharePoint Designer 2013 Workflow error: The HTTP header ACCEPT is missing or its value is invalid

SharePoint Designer 2013 workflow action “Call HTTP Web Service”

SharePoint Designer 2013 workflow action “Call HTTP Web Service”

March 5, 2013 1 comment

Part 1

In this first section we will start creating our SharePoint Designer 2013 workflow. Our focus here is the “Call HTTP Web Service” action. We will be using and Ebay web service for this example. The response from the web service is in JSON (See image below). The “Call HTTP Web Service” workflow action would be useless without the new “Dictionary” workflow action.

Part 2:

In this section we will be taking the workflow a bit further.

1. We will extract the “Title” and “DealURL” data from the JSON response.

2. We will then create and entry in the WebServiceList for each node in our JSON response ( 7 in total )

Reference:

http://blogs.msdn.com/b/sharepointdesigner/archive/2012/09/05/how-to-work-with-web-service-using-call-http-web-service-action.aspx

Getting the logged on user name using the client object model

February 19, 2013 Leave a comment

If you want to use the SharePoint 2010 client object model you can use the code below:

ExecuteOrDelayUntilScriptLoaded(getWebUserData, “sp.js“);

    var context = null;

    var web = null;

    var currentUser = null; 



        function getWebUserData() { 

        context = new SP.ClientContext.get_current();

        web = context.get_web();

        currentUser = web.get_currentUser();

        currentUser.retrieve();

        context.load(web);

        context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), 

             Function.createDelegate(this, this.onFailureMethod));

   }



    function onSuccessMethod(sender, args) {

        var userObject = web.get_currentUser();

        var UserTitle = userObject.get_title();

        alert(UserTitle);

        }



    function onFailureMethod(sender, args) {

        alert(‘request failed ‘);

    }





Here is a video and a simple way to test it.

SP.UI.ModalDialog.showModalDialog with margin and notification

November 16, 2012 Leave a comment

If you ever add HTML to a SharePoint modal dialog box you might notice that adding a left-margin is also necessary. Remember, the HTML option uses DOM not a string.

Style margin Property
Get the code

Adding SP.UI.ModalDialog.showModalDialog to a content editor webpart
 Client Object Model: SP.UI.ModalDialog.showModalDialog(options)
Opening a hyperlink in a dialog box in SharePoint 2010

How do I: Add new values to a drop-down list from the new item form

November 12, 2012 Leave a comment

If you want to have the ability to add new values from new form item you have two options. (that I know of) First you could use $().SPServices.SPLookupAddNew. Or, you could use the technique I have demonstrated in the video below.

Related videos:

How do I: Set the ID attribute of a table row using jQuery

How do I: Implement $().SPServices.SPCascadeDropdowns

How do I: Set the ID attribute of a table row using jQuery and SharePoint Designer

November 9, 2012 Leave a comment

While customizing an “add new item” form, you might find yourself needing to manipulate form elements via jQuery. However, before you can do that you must and an #id or .class to the elements in question. I will be adding an #id in this demonstration. But why would I want to manipulate form elements in the first place? If you wanted to hide/show a textbox based on the user selection of a checkbox you could use this technique.

Get the code

Related videos:

SharePoint Designer 2013 #SPD2013

November 6, 2012 10 comments

I have seen a lot recently about the changes to SPD 2013 and especially the removal of the Design View from page editing and the impact that would have on peoples normal daily SharePoint work. The rational for the change is here on the SharePoint team blog, some of the responses on End User SharePoint are worth a read, and non of them are very positive. So I thought I would take a look a couple of typical End User style visual solution and see it can see be used in the brave new world of SPD2013.

 

Using calculated columns to add colour coding to your SharePoint lists

This excellent solution comes from Sarah Haase. I won’t cover the steps for 2010, but will go straight into 2013.

The 1st step is to grab a copy of SPD2013 preview from the MS download site and get this running in your SP2013 world, then setup your list and calculated column and open your site in SPD2013, at first glance a site in SPD2013 looks exactly the same as an SPD2010, but when you open the list-view you have the option of code view or code view, nice !

So how do we make appropriate change now that we have no visual representation of the page ?

image

If we go to the List View Tools tab section and select the Design tab, we have the option to Customize the XLST for the entire view (this is available in SPD2010 as well)

 

image

Now its a case of searching for the tag

<xsl:value-of select="$thisNode/@*[name()=current()/@Name]"/>

and updating it to read

<xsl:value-of select="$thisNode/@*[name()=current()/@Name]" disable-output-escaping="yes"/>
 

Save the page view,  preview in a browser and voila, a colour coded column in SharePoint 2013.

image
     

So was this more difficult then 2010 ?, The answer is Yes and No, without the visual representation of the page it would have been much more difficult to figure out which tag to update, but once you know that, the actual change is no more difficult, but I think that is the crux of the issue, features like conditional formatting are now going to be much much more difficult to apply in SPD2013 when we are going to have to work through the entire list view code.

How do I: Implement $().SPServices.SPCascadeDropdowns

November 5, 2012 1 comment

Documentation for $().SPServices.SPCascadeDropdowns

In my opinion, the tricky part to this is the third list “CascadeExample”. It was unclear to me after reading the documentation on the SPServices website that the two columns “Country” & “Region” in the “CascadeExample” list need to be lookup columns. It might be obvious to everyone else.

How do I: Implement $().SPServices.SPAutocomplete

How do I: Implement $().SPServices.SPLookupAddNew

Hiding/Showing InfoPath 2010 form element using jQuery

November 3, 2012 Leave a comment

Get the code / Look for the highlight area

InfoPath 2010 is a great tool. However, while building forms in InfoPath it’s only a matter of time when you have a user requirment that InfoPath alone simply will not do. In that case you might have a few options. You could add custom code using VSTA, which means you will need to publish them as an administrator approved form template.You could ditch InfoPath completely and build your forms in Visual Studio 2010 using asp.net. You could build them using the client object model. Lots to think about. In addtion, you could manipulate some form element using jQuery. The video demonstrates a simple way to hide/show a textbox element using jQuery.

Follow

Get every new post delivered to your Inbox.

Join 1,663 other followers

%d bloggers like this: