Archive

Archive for the ‘SharePoint Designer 2010’ Category

SharePoint Saturday in Palestine

October 16th, 2011 Abed Khooli No comments

Yesterday was the second major SharePoint Saturday event in Palestine. Last year’s event was in September, 2010. In addition to local speakers, we had Joel Oleson and Paul Swider from the States and Mohamed Saleh from Jordan. My session was about designing workflows in SharePoint Designer and I wanted to share my slides here. I added a few more to illustrate the use of Visio and InfoPath and also the vacation processing logic.

Here’s the presentation in PDF format (950 KB)

How To Display Tasks Assigned Directly And Through A Group

August 4th, 2011 Abed Khooli No comments

Let’s say we have a traditional SharePoint 2010 Tasks list. The Assigned To field allows both users and groups. Tasks are being assigned both on individual level and on group level. How do you filter your tasks? SharePoint has several views for the Tasks list and two of them are relevant: My Tasks and By My Groups. The first is obvious and the second refers to the group membership of the current user. So, the answer is in the combination of the two.
An easy trick would be to create a web part page and add two web parts to it – one based on the My Tasks view (edit web part, select view) and the other based on the By My Groups view. You stack them on top of each other and that should work.
What we will do in this short article is actually combine them in one view. I created a view (in the browser) based on the By My Groups – actually exact copy. Then I headed to SharePoint Designer and opened the view for editing. I also opened the My Tasks view and switched both to code view. The focus is on the QUERY part. All you need to do is use an Or operator and copy the criteria from the My Tasks view.
The image shows the final query in context (code view of a copy of By My Groups view).
You can see, in the inset, that I have my tasks grouped (expandable and collapsible) whether they were assigned explicitly or implicitly (as part of a group I am a member of).

Linked Data Source In A Records Center

July 17th, 2011 Abed Khooli No comments

What is special about a records center? Well, if you click on data sources in the Site Objects in SharePoint Designer, you only see document libraries (as of SP1) and no lists. And, if you create a linked data source, it seems to work to the last step and you can’t see it among data sources (which are also limited to document libraries). This seems to be by design. However, if you inspect the All Files (under site objects), you can actually find the link data source (under _catalogs/fpdatasources/file-name.xml, where file-name is what you specified during the linked source setup, which could be the title of the first library if you did not specify one – you need to have permission to view All Files, of course, as part of your SPD rights). So, is this useful if we still can’t see it in the interface? The answer is yes.
If you compare a similar working scenario (normal libraries), the data source is almost copied to the page source inside a <DataSources>…<DataSources> element. The recipe is simple:
1. Create your linked data source in a record center as usual (remember the name you give it to the data source).
2. Insert a data form on a web part page (insert – data view – empty data view) and select one of your libraries as the source (we need this to get the xsl stub)
3. Switch to code view and locate the <DataSources>…<DataSources> element and delete everything inside it.
4. Open your data source xml file and copy the elements highlighted in the screen capture and paste inside the <DataSources>…<DataSources> in the code view.
That’s it. You can even delete the xml file and your page should still work.
Notice that you can use a document roll up as an alternative with one advantage: in the linked data source, you have to update the data source if you add a new document library.

How To Identify Unpublished Documents In A Document Library

July 8th, 2011 Abed Khooli No comments

If you have versioning turned on in a document library, including minor versions, you have to publish a major version for your latest editing to be visible to other users. This is the normal draft security settings, which can be changed, but should not. So, how do you recognize your unpublished documents without going into version history?
Well, you could add the Version column to a view which filters on current user [Me] for the Created By column (or may be Modified By if you allow editing of others’ documents). A user can spot versions with a decimal number and take action. Now, what if you want to add some visual indicator? Conditional formatting to the rescue!
Open your view in SharePoint Designer (Version should be one of the columns in the view, if not just add it (list view tools – options – add/remove columns). Select one of the version values and click Conditional Formatting then Format Column (or Row, if you want). In the Condition Criteria dialog, click the Advanced button and enter the following condition:
ceiling($thisNode/@_UIVersionString) != floor($thisNode/@_UIVersionString)
Select/configure your preferred style and save. Your unpublished documents should now be outstanding. The version column may be helpful especially for document authors, but if you selected to format the whole row (ex. background color), you can get rid of the Version column in the table. To do so, highlight the column, go to Table (list view tools) and select Delete/delete columns. Do not use the add/ remove columns!

Using Different Forms For Different Content Types In A List

July 1st, 2011 Abed Khooli 1 comment

In a document library, you can associate a template for each content type. Lists have forms and you can associate forms for different content types. Out of the box, when you edit a list item, you can also switch between content types if more than one are present (as you do with item properties in a document library). When you select a new (content type) from the list items, there is no indication what content type you are using once you start filling it, and in some case, you do not need to see all fields or just want to re-order them. Let’s make a new form for a custom content type.
In this example, I used the OOB Announcements list. I created a new content type based on the Announcement content type and added one additional site column to it. I added the new content type (called AKAnnouncement) to my announcements list, so for my New Item (ribbon) I have new Announcement and AKAnnouncement.
Open the site in SharePoint Designer and go to Lists and Libraries (under Site Objects, left pane). Click the list (announcements) and in the details page, Forms section, click New and fill the dialog. The name is just the first part of the page filename (the extension is already there) – ex. newak. Leave the radio button as is (new item) and only change the drop down box “select the content type to use” to your custom one (AKAnnouncement) in our case. The file will be added to the list of forms. Click it to open for editing. You can re-arrange or remove items that are not required. In this example, we are just adding a header that show the selected content type (read only). To do this, select the Title row, select Table (data view tools, from ribbon) and select insert above. You should see a row with two cells on top of the Title row. You can merge the two cells if you want, I just put Content Type in the left one and the actual type to the right. Save your form.
back on your list details page, lower left, locate the Content Types section (see screenshot), click your custom type (AKAnnouncement in this case) to see its details page. In the forms section (top right), click the hyperlink next to “New Form” and enter the relative url of your form (ex. /sites/teamsite/Lists/announcements/newak.aspx ) and click the save button on the quick access menu (see screenshot).
Back in the browser, try to add a new item based on your custom content type (AKAnnouncement) and you’ll get your custom form. The original announcement will use the default form.