Tuesday, July 10, 2007

"An unexpected error has occurred" in MOSS 2007


Ever wondered what the heck is going on when you are popped with error "Unexpected Error" when developing on SharePoint, well this approach might make life simpler ,it made mine.

Make the following changes :

  • Open web.config of the site you are working on
  • search for "CallStack" attribute in safe mode section and change the value to "true"
  • Search for "CustomErrors" in System.web section and change the value to "false"


and take a sigh of relief atleast now you will have something on screen in developers language.

Tuesday, June 26, 2007

People Picker in MOSS 2007 unable to find user from Multiple Domain

When the sharepoint is installed in environment with multiple domains , the user profile import mechanism only imports the user from the domain in which the sharepoint server is installed.


For eg , if there are multiple domains Domain1.abc.com and Domain2.abc.com and sharepoint 2007 server is installed at Domain2.abc.com , in such case when user profile import is run in SSP , all the users from Domain2.abc.com are imported to user profile database.


when we try to use the people picker control to search for user present in Domain1.abc.com we don't get any results as shown below :



In order to import users from Domain1.abc.com , we need to define new import connection for the Domain1.abc.com and start user profile import once more .

Follow these steps :

  • Open SSP(Shared Service provider)
  • Go to User Profiles and Properties
  • Click on View Import Connections
  • Create New Connection
  • Add the following entries , also shown in figure below

Domain Name :Domain1


Auto discover domain controller(Selected)


Search Base :DC=Domain1,DC=abc,DC=com


Other as default*



  • Start full import and now you should get all users

Wednesday, June 13, 2007

Unable to add domain user to SharePoint 2007 Site

This behavior may occur if the user who you want to add is a member of a Microsoft Windows NT4.0 domain that is joined to your Active Directory forest. The Select users and groups -- Web Page Dialog dialog box does not support Windows NT 4.0 domains. You can use the dialog box to search for and add users who are members of a Microsoft Windows Server 2003 or Microsoft Windows 2000 domain. However, you cannot use the dialog box to retrieve user information from a Windows NT 4.0 domain.


Resolution :
Directly add the user ID to the "add user box" and assign permissions and press OK, this will add the user to the site.

Thursday, May 31, 2007

"MySite" not working SharePoint 2007

I was working on MySite today and while playing around i had no clue what i did but i was sure of one thing that i totally messed it up .

MySite stopped responding and after that only thing which came to mind is "SOS"

Anyways in case you end up in same situation which is very possible in the life of a computer geek , then simply follow the steps .


1)Open Central Administration ->Operations and create a new web application with "My Site Host" as template.
2)Well once you are done with creation of site the only thing remaining is to point the MySite to the new application URL as , so change the URL.

- Go to SSP

- click on "My Site Settings"

- Specify the new Url at "Personal Site Service"

That's It .Try accessing the MySite now.It's up and running.

Wednesday, May 30, 2007

Custom Activity for SharePoint Designer 2007

Every time you start workflow development there is big question in mind, Should i use Visual Studio or SharePoint Designer 2007 and you might end up visual studio if the workflow requirement is bit more than the "out of box" functionality of SPD.

Would'nt it be nice if i can plug in more functionality to Sharepoint Designer.

When MOSS 2007 came into market the impression was that SPD is not much extensible and is to be used for very simple workflow , but i am glad Microsoft didn't made it that stringent and have provided a way to attach custom activities to the SPD.

I have created custom activities in number of work flow scenario and belive me its great .I won't put my procedures in this blog as there are blogs where you can get the complete process. They helped me a lot of understand the "Custom Activities" development.

Here they are :

By Carlos Segura Sanz
http://www.ideseg.com/AddCustomWorkflowActivitiesToSharePointDesignerPart1.aspx
http://www.ideseg.com/AddCustomWorkflowActivitiesToSharePointDesignerPart2.aspx

John Holliday
http://johnholliday.net/archive/2007/03/27/Add-Your-Own-Custom-Workflow-Activities-to-SharePoint-Designer-2007.aspx

SharePoint Designer Team Blog http://blogs.msdn.com/sharepointdesigner/archive/2007/03/15/adding-activities-to-spd.aspx

Well majority of them speak about same stuff , but cross reference helps to make understanding much clear .

HAPPY WORK~FLOWING!!!!

Wednesday, May 23, 2007

People Picker Control for Infopath 2007

Ever wanted to have a people picker kind of control in Infopath form and that too in browser mode. Did i heard yes :) , well there is a Active-X control which takes care of this part named "Contact Selector Control".

Just follow the steps to get it working :

Add Contact Selector to Controls Pane

  • Click the "Add or Remove Controls " from the Control Task pane as shown in figure





  • Click ADD
  • Select Active-X
  • This will display a list of controls , select "Contact Selector" ,click Next
  • Select "Don't include a .cab file"
  • From drop down select "Field or Group(any data type) and click finish

DataSource for the Contact Selector control

  • Add non Repeating group named "group1"
  • Add a repeating Group names "Person"
  • Add following test field to the "Perosn " group (DisplayName,AccountId,AccountType)


Add Secondary datasource XMl file with details about the SharePoint Server , this is required by the form in order to validate the user against a particular sharepoint server .

  • Open Notepad and add the following Tag <Context siteUrl="http://<servername>"/>
  • Save the file as Context.xml
  • Add new connection as "Receive Type" and source of data as "XML"
  • Option “Include the data as a resource file” shoule be enabled


Drag control to the form and you are all set .


Best of Luck !!!!

Monday, May 21, 2007

MOSS 2007 Webcasts and Videos

I was planning to make a list of good webcast and video on SharePoint , Thanks to Steve Sofian for taking this initiative :-)

These are some good collection of sharepoint concepts :

http://www.sharepointblogs.com/ssofian/archive/2006/07/28/9532.aspx


Enjoy!!!!

Tuesday, May 15, 2007

People Picker not able to identify users in forest with multiple domain - SharePoint 2007

I am working on this issue from past 2 days and belive me it's very time consuming in case you dont get the solution ASAP . Thanks to Joel Oleson's Life blog which talks about the same.

To keep it short i would just give the problem statement and solution to get it working .


Problem Statement :
When Sharepoint server 2007 is installed in environment with more than one domain , there is a tendency of people picker control to search only in domain where the portal is installed .
E.G Consider following environment as example

Forest Name :test.com
First Domain :First.test.com
Second Domain :Second.test.com


In such case if you install sharepoint server in domain First.test.com , the people picker might not recognize users from Second.test.com.
So what could be done to make it work .

Solution Description :
Note : First make sure that there exist atleast a one way trust between the 2 domains(First.test.com /Second.test.com) and follow the steps.

First Step :
Run stsadm.exe to set the password used for encrytion/de-cryption

stsadm.exe -o setapppassword -password
eg stsadm.exe -o setapppassword -password testpassword


Second Step :

Format of command :
stsadm.exe –o setproperty -url {} –pn "peoplepicker-searchadforests" –pv {list of forests or domains}

The format of {list of forests or domains} is a list of

forest:DnsName,LoginName,Password
or
domain:DnsName,LoginName,Password

separated by semicolon.

As per our example the command is like

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN>stsa
dm.exe -o setproperty -url "http://localhost" -pn "people
picker-searchadforests" -pv "forest:test.com;domain:First.test.com;domain:Second.test.com" ,{domainusername},{domainuserpassword}


Last step IISRESET might not be needed (i did that :) ).

And you are all set , try the People picker search and you get all the users.

Friday, May 04, 2007

Customizing MySite in SharePoint 2007

Well i was searching for a methodology to customize MySite in SharePoint 2007 and Volla!!! i got this excellent article:

Customizing MOSS 2007 My Sites within the enterprise

Sunday, January 28, 2007

Customizing Asp.Net 2.0 application to look like a SharePoint 2007 Portal : Approach 2

As we saw in my previous blog , one of the simpler approach to achieve the “Consistent UI” in Asp.Net application when they are run together with SharePoint portal .


Now we will check out the second approach where we have the same “Financial Application” and we have following requirements:



  • The UI of the existing application must be similar to existing portal

  • The Application must be executed under the same context of SharePoint portal

In order to achieve these we need to perform following:


Consistent UI :
In order to achieve the same UI as of portal, we have to use the “Master Page “of the portal. Inherit all the .aspx page of your existing application from Master page of portal.

SharePoint portal Context:
In order to run the portal under SharePoint context, copy the complete application folder to “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS”

Let’s convert our existing “Financial Application “in order to adhere to the above mentioned requirement.


Step 1: Getting application to SharePoint Context


Copy the complete application folder of the “Financial Application” to


“C:\Program Files\Common Files\Microsoft Shared\web server

extensions\12\TEMPLATE\LAYOUTS”









Now we can access the same application under context of SharePoint portal, use the following URL

http://localhost/_layouts/financialapplication/default.aspx and we get the following page:




As we achieved one step of getting our application to the SharePoint context, our next step is to achieve SharePoint UI:




Step 2: Setting application UI to that of SharePoint


As mentioned above we can achieve the SharePoint UI by simply inheriting the master page of our portal. In order to achieve this lets open your “default.aspx” of “Financial Application “in Visual Studio 2005/Notepad.


In the page directive of “default.aspx “page add attribute:

MasterPageFile="~/_layouts/application.master" and add following directives:

  • <@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>;

  • <@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" >;

  • <@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" >;

The page would be like this:




Once we are done with the master page reference we need to define the content of the page. As Master pages contains content placeholders we need to place complete “Form” section of our application to the appropriate content placeholder of the default.aspx. Lets define a content placeholder element in “default.aspx” page:


<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderMain" runat="server">asp:Content>

Lets copy the complete form elements from our default.aspx and add it to the ContentPlaceholder named “PlaceHolderMain”. Copy all elements of <form> tag as shown below:




And paste it inside the content placeholder.”Default.aspx” now looks like:




Let’s define the Title too using the ContentPlaceHolder “PlaceHolderPageTitleInTitleArea”


Add the following in “default.aspx” for defining title:

<asp:Content ID="Content2" ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">Financial Application<asp:Content>

It seems we are done. Now when we try the same url http://localhost/_layouts/financialapplication/default.aspx

We get the page with SharePoint UI as shown below:


That’s it, 30 min of effort and your application seems to be a SharePoint application and now you can go forward and use the SharePoint context to achieve any tweaking with the SharePoint portal . You can get the code for Changed "Financial Application" from

http://www.box.net/index.php?rm=box_v2_download_shared_file&file_id=f_40004506

Saturday, January 27, 2007

Customizing Asp.Net 2.0 application to look like a SharePoint 2007 Portal: Approach 1

In any organization you can find plethora of application implemented, which are dependent /independent of each other. When such organization decided to move the portal way then the “AIM “ is to provide one “Window” for information for complete organization .This can be achieved by integrating the existing application with the portal application .In such case one important rule while implementing portal is to maintain “Consistent UI” across organization portal . The “consistent UI “site receives better acceptability by the end user. I got this requirement and wanted to share the simplicity of achieving this in SharePoint 2007 portal.

For showcasing this I have taken a web application which is a virtual “Financial application” for an organization .We will go forward and give this application “MASK OF SHAREPOINT”, doing that we achieve the important principal of portal acceptability “CONSISTENT UI”. There are number of approach which can be implemented to achieve. We will see both the case.

Let’s see how our application looks before we start our makeover:




As we see our application is a plain app which does basic computation.


First Approach:


In case we have independent application and just need a share point MASK in such case we can use “Page Viewer web part” .In Order to implement this , create a new SharePoint page in your SharePoint site .Site Actions->Create Page.


Name : Finance Application


URL : financeapplication
Page Layout: Blank Web Part Page



Press “Create”, you will get the page as shown below:




Click on “Add New Web Part” and select “Page Viewer Web Part” from the list.




Click “open the tool pane” in the web part to specify the finance application URL, and click apply.




You will get the “Finance Application“ page inside the “Page Viewer web part”, you might get the frame as the “Page Viewer Web part “ width and height is by default set to fit the web part zone .Feel free to modify the dimension of page viewer web part . Result page looks like:



This approach can be used in following situations:




  • When the application is completely independent and don’t need any information from the portal site i.e. it’s not required to run the Asp.Net application in context of the portal application

Second Approach:



This approach is advantageous when the application needs to “Run in the same context of SharePoint portal “


e.g.

  • Developing SharePoint administration custom page


We will see this approach in the next blog ;-). BREAK

Reference Architecture: Building a Cost Optimized, High-Throughput HL7, EDI, and FHIR Processing Pipeline on OCI ( Published in Oracle Blog)

 OCI (Oracle Cloud Infrastructure) provides more than 200 services to build your next enterprise application. Explore the blog to learn how ...