Showing posts with label Code Free. Show all posts
Showing posts with label Code Free. Show all posts

Tuesday, December 16, 2014

SharePoint designer 2010: “the business data connectivity metadata store is currently unavailable”

This was driving me crazy the other day… I tried everything, reconfiguring the services, installing updates I didn't need, uninstalling SharePoint Designer and installing it again, 32 bit, 64 bit, what ever you want.

Every time i opened SharePoint designer and tried to add an external content type, I got this error:

image

 

Then I realized I was doing 2 things that might be the issue:

1. I was running 64 bit of SharePoint designer

2. I was running on my SharePoint Server itself, in a dev machine on CloudShare

So, I went ahead and installed SharePoint designer 32 bit on my client machine – and what do you know, it was working.

Now, the question is what was the problem – running on the server, or running the 64 bit version?

So, I uninstalled the 64 bit version and installed the 32 bit version just out of curiosity…

And what do you know? Same error message… It appears that this is not working when running on the server itself.

It might be specific to my configuration – but if you run into this error, try installing the designer on a different client machine.

Good luck!

Thursday, October 30, 2014

The power of data view plus web part

Hey guys, thank you for joining me today on my web cast.
Here is the presentation from today’s web cast, if you missed it you can view the recording here.
This presentation talks about KWizCom's data view plus web part, which is an enhanced, more simple and more versatile version of the data view web part. This product does not require SharePoint designer to use, or messing around with XSLT. Simple create, use and reuse templates using simple html, css and javascript, and share with others.
Here are a few samples of what you can do with this amazing web part:

Image slideshow:
image
Blog:
image
Few tasks samples:
image
image
image
Let me know what you think

A link to the product page: http://www.kwizcom.com/sharepoint-add-ons/data-view-plus/overview/

Tuesday, August 5, 2014

Using minimal.master in SharePoint breaks AJAX

Funny story, I just spent the better part of a day trying to figure out why our products do not work properly on a customer’s custom master page.

He was using SharePoint 2013, and using the new feature that allows you to upload an HTML file template and have SharePoint convert it to a master page automatically.

Then I tried some of the out of the box sample master pages: Oslo.master, Seattle.master and a minimal.master that I created using the design manager under site look & feel:

image
Click “Edit master pages” on the left navigation bar:
image
…and click “Create a minimal master page” above the list.

See, all master pages that I tried worked perfectly, except the minimal.master I created and the master page from my customer.

After a long comparing, trial and error I came up with this simple solution, there are just a few things to change to make AJAX work on these pages:

1. You need to remove the SPWebPartManager from the head. This control must be inside the ASP.Net form tag in order to work properly:

<!--SPM:<SharePoint:AjaxDelta id="DeltaSPWebPartManager" runat="server">-->
<!--SPM:<WebPartPages:SPWebPartManager runat="server"/>-->
<!--SPM:</SharePoint:AjaxDelta>-->
2. Next, you must add the SPWebPart manager along the the missing script manager control as first children of the body:

<!--SPM:<WebPartPages:SPWebPartManager runat="Server"/>-->
<!--SPM:<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>-->

And that’s it, now my ajax updates were working correctly and there was much rejoicing.


I can’t say there won’t be any other issues with these master pages in the future, that’s why I recommend you don’t start with minimal.master, but instead, use the default, Oslo or Seattle – these look much more stable and work right out of the box without the need to tweak them first.

Good luck!

Tuesday, May 6, 2014

New / Edit form loads but not responding for 10 seconds

Ok, something we have been struggling with for months and drove many of us at KWizCom a bit crazy…

It is hard to explain, so I’ll try my best:

In our internal portal, we are using SharePoint 2010.

In our current bug tracking list, we use a SharePoint list similar to the issue tracking, every time to click on a new item or edit item – the page loads quickly enough, but it is stuck and not responding for up to 10 seconds sometimes.

After 10 seconds, the page completes loading, rich texts load their toolbar, and the ribbon starts working.

We have over 4000 items in that list, and the problem just becomes more and more of an issue as the list grows.

After a lot of trial and error, I finally managed to pin point the code that makes the browser stuck:

It is a javascript file called “groupeditempicker.js”, and more specifically, a function called “GipInitializeGroup”.

After a little research, I realized this code is a part of the SharePoint out of the box multi-lookup column picker (the left-right-boxes like we call it), which was looking up items from the current list as related issues.

Once I converted this lookup into our Cascading Lookup with “edit on demand” flag, which was designed to work on large list lookups – the problem was solved immediately.

Not sure how many people out there will encounter this issue, and from them how many will find this post – bug if you did, leave me a comment! I am curious to know if it was just us.

Happy SharePointing,

Shai.

Edit: A link to KWizCom cascading lookup product. This product can show multi - lookup as a grid control with paging and checkboxes, and supports a mode we call "edit by request" which means if you edit the item - this field will display the view mode of the current value. If you want to modify it, you have to click on the edit button to change it into edit mode. This feature is very useful for huge lookup lists that you do not modify every time. Cascading lookup page

Monday, July 20, 2009

Helpful batch file command for installers

Hi,

Just a short one this time,

here is a nice script for looping through all MSI files in current folder / sub folders and running the installers one after the other.

Just paste this into a install.bat file and place with your set of installers:
for /f "delims=" %%a IN ('dir /s /b *.msi') do MSIEXEC /i "%%a"

simple, 1 line of script made my life easier with WikiPlus.

You see, installing it involves running installers for 5 different products so this way I just throw them into sub folders and this little script does the rest for me.

:)

Enjoy,

Friday, November 21, 2008

Want to know how to change MOSS search results sort order?

Hi,

Some of you may have seen my post on how to add rating field to MOSS search results,

Since than I have had several customers that wanted to allow their users to sort the search resutls by that rating field, and not by the relevance / date (Even though I explained that this will break the MOSS search relevance mechanism).

Be that as it may, after searching the web - I managed to locate several "free tools" that does that, but I was determined to find a more simple solution that did not involve downloading/executing any out side code on my server.

Finally, I found that this can be done by a very simple change to the XSL of the main search results body web part (the same one we modified in the previouse post).

Simply replace this statement in the XSL:
<xsl:apply-templates />

With this one:
<xsl:apply-templates>
<xsl:sort select="rating"/>
</xsl:apply-templates>


Note:
You might want to allow the user to sort by relevance / date and rating, and not only rating. In that case you should use the actions web part above the main search resutls web part and add a new option there to specify when it should sort by rating and not do it hard-coded in the results XSL web part.


Hope this helps,
Shai Petel,
VP R&D

Tuesday, October 7, 2008

Adding "Contact Us" to a SharePoint site

Whether you are hosting a WSS support site, or a publishing eCommerce site hosted with MOSS WCM, a lot of times you will find the need to allow your users to contact you using a simple "Contact us" form.

Well, this cannot be more simple in SharePoint.

This is how it is done with no development at all:

Create a list named Contact Us with fields: Subject, Body, To.

the To field - can be a user field or a choice field.

If it is a choice field (like: sales / support / partnersprogram etc...) you can do a WorkFlow using SharePoint Designer workflow wizard that sends the email to the manager / mailbox address of that subject.

If it is a user field - you create a view called: MyEmails - and set the filter to show items where To=[Me], so every user gets his "emails". Then you set up alerts to all users for new items in that view so they would get an email whenever a new item was created. (or you can do the WF solution as well).

Simple, Free and Out of the box.

Users will not see the actual email address of the person they are sending the email to, and the email will be sent from the SharePoint itself - so no spam.

You can extend this solution by adding a custom "Contact Us" form to create an item in the home page (use Custom List Form in SharePoint Designer, or Item Editor Plus from KWizCom to do so).

Also - you can use SharePoint to track these issues by adding a "Status" column that the user in charge can mark as "New, Waiting for someone else, Completed", or use the WF to create a task for each issue that is assigned to someone...

Lots of ideas, the nice thing is it is all free and you can extend and improve your solution as you go along!

* If you need help with configuring such a solution, contact me as we offer online training for these subject and in 4-5 hours online training you will be able to create and manage your own solutions even if you don't have any development experience.

Shai Petel,
VP Professional Services
KWizCom

Thursday, August 21, 2008

How to add MOSS search to internet explorer 7 search box

This is a rather easy and cool task...

May time people ask me how they can add their SharePoint search to the internet explorer 7 search box:


Now, I know... if you have internet access - there is no problem. Just click on the "Find more providers" and follow the instructions and you are done.

But - some customers do not have internet access on their client machine, or some administrators would like to publish this configuration through an organization... so a little registry tweaking will do the trick!

Simple take this text:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchScopes\{33093C07-A5A2-418A-AB53-C187BC95DAED}]
"DisplayName"="KWizCom Portal Search"
"URL"="http://portal.kwizcom.com/searchcenter/Pages/Results.aspx?k={searchTerms}"


Replace the "KWizCom Portal Search" with the search provider title you want,
Replace the URL address with the one of your search page (to find out what it is - Simple do a search and copy the resutls page address), and replace the word(s) you searched for with the {searchTerms} token.

Save it as a search.reg file using notepad, and run it!

Also, you can add almost any other search provider in the same way, for example to search in KWizCom addons site you can use this search address:
http://www.kwizcom.com/search.asp?SearchString={searchTerms}&pageID=1


Easy, isn't it?

Thursday, August 7, 2008

How to add rating field to MOSS search results?

This guide will show you how to add custom fields – specifically a KWizCom Rating field to the MOSS search results page.

This article will only demonstrate how to add the field to the results, but much more things can be achieved using simple XSL editing like: Add sorting or grouping by special fields.

This task is mainly done in 2 parts:
Part 1: Add the Rating field to the search Index Engine
Part 2: Customizing the search results page

This article assumes you have installed KWizCom Rating Field Type and created a field in a list named: “Rate” of type “Rating”. If you haven’t done so please complete these requirements before you continue.

Part 1: Add the Rating field to the search Index Engine

1. Open SharePoint Central Administration
2. Browse to your Shared Services Provider (SSP)
3. At the SSP home page, please click “Search Settings”
4. Go to “Metadata Property Mappings” link
5. Click “New Managed Property”
6. Set property name to “Rating”, Type = “Decimal”
7. Select “Include values from a single crawled property based on the order specified”
8. Click on “Add Mapping”
9. Search for your tags fields. If you do not see any of your tags fields – you may have to manually crawl the SharePoint content source before you can continue.
10. If you have more than one property of type Rating – please search all of them and add them to this list.
11. Click OK twice to confirm the new managed property.

Part 2: Customizing the search results page

12. Browse to your search site
13. Go to the results page ( or simple perform a simple search go get there)
14. Click Site Actions -> Edit Page
15. Locate the “Core Results” web part
16. Choose to modify the web part properties
First – we will add the Rating managed property to the results XML:
17. Open the “Results Query Options” group, and click to edit “Selected Columns” property
18. Add the Managed Property “Rating” to the Column Names.
19. Next, we will have to edit the XSL for the result item template.
20. Expand the “Data View Properties” tool part, and click “XSL Editor”
21. Locate in the XSL the template “<xsl:template match="Result">” and update it to look like this:
<!-- This template is called for each result -->
<xsl:template match="Result">
<xsl:variable name="id" select="id">
<xsl:variable name="url" select="url">
<span class="srch-Icon">
<a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</a>
</span>
<span class="srch-Title">
<a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHTitle[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHTitle">
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="title"></xsl:otherwise>
</xsl:choose>

<xsl:if test="rating > 0">
User Rating: <b><xsl:value-of select="rating"></b>
</xsl:if>

</a>
<br/>
</span>

<xsl:choose>
<xsl:when test="$IsThisListScope = 'True' and contentclass[. = 'STS_ListItem_PictureLibrary'] and picturethumbnailurl[. != '']">
<div style="padding-top: 2px; padding-bottom: 2px;">
<a href="{$url}" id="{concat('CSR_P',$id)}" title="{title}">
<img src="{picturethumbnailurl}" alt="" />
</a>
</div>
</xsl:when>
</xsl:choose>
<div class="srch-Description">
<xsl:choose>
<xsl:when test="hithighlightedsummary[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedsummary">
</xsl:call-template>
</xsl:when>
<xsl:when test="description[. != '']">
<xsl:value-of select="description">
</xsl:when>
</xsl:choose>
</div >
<p class="srch-Metadata">
<span class="srch-URL">
<a href="{$url}" id="{concat('CSR_U_',$id)}" title="{$url}" dir="ltr">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHUrl[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHUrl">
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="url"></xsl:otherwise>
</xsl:choose>
</a>
</span>
<xsl:call-template name="DisplaySize">
<xsl:with-param name="size" select="size">
</xsl:call-template>
<xsl:call-template name="DisplayString">
<xsl:with-param name="str" select="author">
</xsl:call-template>
<xsl:call-template name="DisplayString">
<xsl:with-param name="str" select="write">
</xsl:call-template>
<xsl:call-template name="DisplayCollapsingStatusLink">
<xsl:with-param name="status" select="collapsingstatus">
<xsl:with-param name="urlEncoded" select="urlEncoded">
<xsl:with-param name="id" select="concat('CSR_CS_',$id)">
</xsl:call-template>
</p>
</xsl:template>
22. You can only add the following to the existing XSL you already had there instead of pasting the entire tag:
<xsl:if test="rating > 0">
User Rating: <b><xsl:value-of select="rating"></b>
</xsl:if>
23. And you should get results that will resemble this:
24. For debugging reasons, should you wish to view the results RAW XML, copy the existing XSL to notepad for backup, and use this XSL instead:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes">
<xsl:template match="/">
<xmp><xsl:copy-of select="*"></xmp>
</xsl:template>
</xsl:stylesheet>


Hope this helps, if you have trouble doing it yourself we offer this customization as a part of our remote consulting services, contact sales at kwizcom.com by email for more information on that.

Thanks, Shai Petel.

Monday, July 21, 2008

How to hide a field in edit or new item form

I get this question a lot...

How can we hide a field from a specific user, or completely from the edit or new form?

Well the hard way (and SharePoint approved) would be to write some .NET code against the SharePoint API and changing the field visibility - I will not go into it now.

Other way - still hard, is to change the field CAML definitions (Xml files) - also for existing fields not recommended at all - I will not go into it now as well.

There is a much easier way, no code envolved, simply by adding a content editor web part to the page with some javascript that will hide the field content form the user.

It is not perfect, sure. It can be fooled, right.
But for those of you that just need it for cosmetic reasons mostly, this is the perfect solution.

I actually covered that in an older post, I just think its title was not clear enough - please follow this link for the complete how-to manual.
http://kwizcom.blogspot.com/2007/08/managing-field-control-visibility-way.html

Thanks, Shai.

Thursday, July 3, 2008

Creating a view for birthday


Well, I struggled with this for an hour or so until I finally found a solution...

Scenario:
our customer has a list of users with a date field with their Birthday.
He wishes to see the upcoming birthdays for users in the upcoming week.

Problem:
The birthdate field holds the actual birthday of the user (i.e. July 24 1980), but he wants to see it as July 24 2008... July 24 2009... and so on.

Well, since we cannot use the [Today] field in calculated column (all tricks wont work - the field won't update!), I have conjured this solution that only asks for a yearly update to the column:

First, we have to create a calculated column that results in the current year birthdate
(from July 24 1980 to July 24 2008)

1 - create a date column to hold real birthday (named: BDay) or type date.
2 - create a calculate column to hold this year's BDay (named: YBDay).
3 - set the output type of the calculated value to "Date and Time"
4 - use this formula to generate its value:
=DATE(2008,MONTH(BDay),DAY(BDay))


Now, the rest is easy:
You create a view and set filter to 2 conditions:
where [this year birthday] >= [Today]
And
where [this year birthday] <= [Today] + 7


Now, you see all birthdays for the upcoming week!

Just remember - next year you will have to update the formula of the calculated field.

Hope this helps you - sure did saved me :)

Monday, June 30, 2008

Add content to SPList Item view form

Hi,

I am sure this is a shared whim to many SharePoint implementation -
You have a list of cusotmers or what not, and you want to add more information on the view item form, like so:


So basically when you view an item on that list - you will see additional information like:
* Results on that customer from google on an iframe
* Stock information for that customer
* Information from external system - showing in a frame that gets the customer ID in query string

And much much more.

Right so first thing you have to do is to learn that the list forms (edit, new and display) are actually normal web part pages, with one web part by default.

You can very easily add more web parts to that form, all you have to do is to add this to the query string of the form and you will go into edit mode of that page:
&ToolPaneView=2



Another way is to paste this into your address bar:
javascript:MSOLayout_ChangeLayoutMode(false)

I know you can use SharePoint Designer - but this is much easier and does not involve nothing more than your browser...

Now that you got into edit form of the current item - you can add any web part you want.

Inside your web part code - you can make use of the SPContext.Current.Item to get the current item that is being loaded to the form and use it to render what ever you like.

But wait!

Actually, I just finished creating a new product called "Current Item Property" that does that and more:

By adding it to a list item form or to a WCM publishing page (or to a web part page in a document library for that matter) you will be able to do almost anything you wish.

How does it work?
2 simple properties of the web part:
First - allows you to specify what fields from the current item you want to use
Second - allows you to choose how to format that information in C# syntax (using {0},{1} etc).

After you set up the information you want - this web part can either send it by connection to another web part to use (like RSS viewer as the RSS feed url) or is can simply write it to the page (when you want to create HTML from the information, or writing an iframe with changing URL).

So - lets go over what can be done with this (few examples from my customer)

We are starting with a simple list:


1 - Showing RSS information for partner


- Create a field in the list called "Stock", and set the stock ID for each partner
- Add the "Current Item Property" web part to the page


- Set it to use "Stock" field
- Set the format to a RSS URL: http://finance.yahoo.com/rss/headline?s={0}


- Add an RSS Viewer to the page


- Connect the two web parts using the RSS viewer "Get RSS URL" connection


Done!


2 - Showing Stock infromation for customer


- Create a field in the list called "Stock", and set the stock ID for each partner
- Add the "Current Item Property" web part to the page
- Set it to use "Stock" field
- Set the format to the iframe: <iframe style="WIDTH: 400px; HEIGHT: 150px" src="http://ichart.finance.yahoo.com/t?s={0}" frameborder="0"></iframe>

- Check the property "Show Content"


Done!

3 - Showing google search results for issue


- Add the "Current Item Property" web part to the page
- Set it to use "Title" field
- Set the format to the iframe: <iframe style="WIDTH: 400px; HEIGHT: 150px" src="http://www.google.com/search?q={0}" frameborder="0"><iframe>
- Check the property "Show Content"
Done!

This way it took me 5 minutes to add more content to the list items!
The product will be released soon and it will come with few format templates for: RSS, IFrames etc - this is what we are working on now: how to package it and how to use it.

If you want more information on this - email us at sales@kwizcom.com or visit http://www.kwizcom.com

Thanks, Shai.

Wednesday, June 18, 2008

How to improve SEO of you WCM sites

Well, as many of you might know - the most important thing for an internet facing web site is to be found easily in the leading search engines.

Because it does not matter how nice and sexy you "pimped" your web site, nor how relevant and profound is the content - if no one can find it your web site is as good as dead.


Ok, so you will be happy to learn that WCM (Web content management) sites that are created in SharePoint 2007 are pretty SEO-aware (Search Engine Optimization), and this comes a long way for you.


Some key features you enjoy with no hard work:


* Navigation, is configured OOTB (Out Of The Box) to reach all pages, expose them to the search bot / spider / what-you-might-call-it. All links are true a href links, no scripts.
* Zero to none use of hidden frames (only place you'll find them is in authoring mode
* Caching support and special attention for anonymous users (used by the search engines)


And much much more...



But - we are here to see what can we do to make it even better? How can I improve my site SEO?



Well, from a little research I did for a customer of mine while back we found 3 things that are actually can improve our SEO greatly.
(Important: I and not teaching how to cheat search engines! This is very dangerouse to play with. Simply how to make your site friendlier to search engines. You still have to have good content, incoming links and such to get good ratings on your site)



1: Turning off the view state.
2: Adding a site map for google.
3: Adding meta-tags for keywords and description for relevant content pages (advanced)

Ok, so let's go over these options and see what is the benefit and how it can be achieved:


Turning off the view state


What is gained?


If you right click->view source on any content page in MOSS you will see right at the beginning of the body tag you will see a input type hidden tag with id=__VIEWSTATE... then, its value will pretty much take your entire page so you'll have to scroll down several times...

So, apparently this gigantic piece of information is something that most search engines do not like to say the least. Especially when it comes before you true content of the page - it ruins your content rating in the search results!

Another obvious reason is, your page is larger... and larger pages are slower to load, and search engines will mark your page as a slower page... we don't want that.

How is it done?


Removing the view state from your WCM web application is rather easy. Simply go to your web application root directory (usually smth like: c:\inetpub\wwwroot\wss\xxxx),backup web.config file, and open it for edit in notepad. Look for enableViewState="true" and change it to false.

No need for IISRESET, but you site will experience a very small delay on the next request.

Adding a site map for google.

What is gained?

When a search engine (google in my example) starts indexing a web site it first of all checks to see if someone had prepared a "work order" for him. This "work-order" is what we call a sitemap / site map XML file that will allow us to make special requests for the crawler when it is working on our site.

If we do not have such a sitemap file, the engine will just open the home page of our web site and start crawling all links it can find on it for sub pages and so on and so forth...

This is usually good enough, except for cases where:

We want to have a section in our site that is not exposed by a link at the top site. Like http://www.kwizcom.com/ will not show a link to www.kwizcom.com/support (only example) which will hold our products support forum.

In this case - with no site map, our /support site will not be available at google at all.

Another problem we can prevent using a site map file is, when you have the same content in 3 different pages on your web site. 1 at the home page, and twice at the specific product information pages... Google will think you keep duplicate content and will lower your web site rank!

Using a sitemap, you can choose specifically what pages you want google to crawl, what pages are more important than others and what pages you don't want him to load.

One last benefit you gain by using a site map is that you can tell the engine what is the lifespan of each of your pages. Meaning: how often does its content change - monthly? weekly? so google will be sure to check it up every once in a while and update its content. Cool, eh?

How is it done?

Well, building a site map for MOSS (or any site for that matter) can of course be done manually, but you have to keep in mind that we are talking about a lot of pages to add to the XML files and this can be very time consuming!

Furthermore, you have to rebuild your site map every once in a while to reflect changes, additions and deletions...

You can develop a utility that does that for you, or use our site map builder here:

http://www.kwizcom.com/ProductPage.asp?ProductID=737&ProductSubNodeID=738

Once you got your hands on a site map generator, your work is just starting:

You will need to make changes in the XML to hide pages you don't want to show, change rating for more important pages and customize other information on it to match your requirements.

Adding meta-tags for keywords and description for relevant content pages (advanced)


What is gained?

By adding a meta tags of keywords and description to your pages you will let the search engine what content is your web site or web page targets.

This helps to raise the quality of the content in your web site. You may want to add specific keywords /description to all pages, and allow some pages to have additional information added to them.

How is it done?

Doing this can be very simple or very complex depends on your needs...

In the most simple straigh forward way - just edit your web site's master page and add the meta tags for keywords + description to the HTML head node like so:

<meta name="Description" content="KWizCom, knowledge worker components">

<meta name="Keywords" content="buy web parts, products, sharepoint, wss, moss">

But, if you requier your content to be changed according to the information of the current page (let's say you wish the page's title to go in to the description along with the site's name, and you have a metadata field named: keywords you wish to be loaded into the keywords tag), things get a little tricky.

But not to fear! I have created a control that will allow you to plant it in the master page and define what exactly you wish to see in these meta tags... it's just that using it is a bit tricky, so for now I don't have time to elaborate. But if you want it anyway before I manage to write a post about it - write me to shai at kwizcom.com and I will send it to you and try to help you configure it.



Ok, that concludes my post so far... it's been a very long while since I posted here, just in case you wondered - I relocated myself to Thornhill ON and didn't have enough time for nothing...

Hope this helps some of you,

Thanks,

Shai Petel

Tuesday, November 20, 2007

Importing Data from AD to InfoPath 2007 Form Template (Code free)

Hi all,
Several of my customers have learned about the new feature of MOSS that includes publishing InfoPath forms to the server and thus allowing users that does not have InfoPath installed to fill in forms with no need for distributing nor purchasing InfoPath for each client.
One of the things they all have in common is that they all work in a Microsoft Active Directory environment and wish the form to load Meta data from the current user and to fill in the form with that data.

Now, InfoPath and AD does not have a method for creating a direct connection, but since all of our users also utilize the Microsoft Office SharePoint Server (MOSS) forms server – this means they can take advantage of other features and capabilities of MOSS for this problem.
MOSS connects to your AD easily and builds a user profile based on the data stored in AD for each user. This part is easy enough to perform so I will not elaborate further on that here.
Once your MOSS “knows” your users, you can make use of its web services to retrieve all users list, a specific user profile and also the current user profile.
Here I will demonstrate how to create a form that loads current user profile data as stored in AD without writing any bit of code.

The only thing that needs to be done is to define a connection to a certain web service that already exists in your SharePoint site out-of-the-box (OOTB).

Step 1: Create a blank form template
1. Click file->design a form template



2. Select “Blank”


3. Click OK

Step 2: Setting up the web service connection

1. Create a new data source connection.

Go to tools –>Data connection



2. In the ”Data connections” dialog Click on Add



3. Select create a new connection to - Receive data Click next



4. Select Web service as the source type



5. Insert the Following web service name: http://<servername>/_vti_bin/userprofileservice.asmx?wsdl


6. Replace <servername> with your SharePoint server name and click next


7. From the operations drop down list select GetUserProfileByName



8. In MOSS, calling this operation without sending a user name will return current user’s profile.

9. Click next keeping the defaults in every screen until you can hit Finish




10. Close the Data connection window.


Step 3: viewing and choosing the AD details we wish to import:

Now, we need to insert the AD information to the correct fields. To do so, we first need to see what kind of data we can use.
Since the users profile may include different properties according to software installed on your organization and other dependencies, the web service results returns a set of “name-value” collection that we can use in order to get re results we need.
So – first, we have to find the “name” of the property we need and use it to get its value from the web service.
Here is how it is done:

1. To see all the available fields click on View -> Data source


2. In the Data source drop-down select the one we just created.


3. Expand the DataFields container node and select the following fields in the results:


4. In the drop-down menu on the selected nodes select repeating table and place it in the form.




5. This created a repeating table with all data returned by the web service. To see all the AD fields available to you, Click preview in the tool bar.


6. Now, locate the property you need and copy its name


7. Return to the design mode by clicking close preview.


Step 4: placing the AD details in the controls:
Now the only thing left for us to do is place the field we chose earlier in step 3 and define the control to show that field’s info.


1. In the form double-click the control you wish to fill


2. In the control properties click on

to open the function editor





3. Then click on insert Field or group.


4. In the next window select to data source you created


5. Expand all the folders under dataFields until you can select the Value node.

6. This inserts one of the “values” we got in the web service response. Now we have to make it “filter” the values by the property name we want.

7. Click on filter Data button. In the pop up window click on add


8. In the next window select the following options


9. And select the “name” node from our service data source:



10. Click ok. Then Select type text and enter the property you copied in the previous section as the value


11.Click OK to confirm and close all the pop-ups.


12. Click preview in the tool bar to see the results.






Now your form displays the user preferred name as it was entered in the AD without writing 1 line of code!

Important:
Your document must be fully trusted in order to execute the web service correctly. To do so please check the tools-forms options form security options.


This is a great demonstration how several Microsoft products can be combined to create excellent customer-specific solutions with just utilizing the capabilities of the OOTB features.

Post by: Adi Lebovich and Shai Petel.

Thanks,