notice
March 2nd, 2010 | Categories: Customization, SharePoint, WSS 3.0 | Tags: , ,

People/Group field in SharePoint allow us to keep adding the existing user(s) or group(s) into the document library or list item. Let’s think, I have a list where one field name i.e. Assigned To (reviewer) is type of People/Group. Objective is when I assign someone to review the list item, and then an email notification needs to be fired up to that reviewer.
In other words, you have to find that person from the UserCollection list in SharePoint and send an email to that associated person.

Now once you assign one person on this field, you will found how the SharePoint display  his/her name in the New/Edit OTB form and it is like DOMAIN\LOGINNAME. So if your domain name is SP-SERV and your name is Himadrish Laha, it will be looks like SP-SERV\Himadrish Laha.

People O rGroup Field

Below the simple code I have used to fetch the string data and it returns me something else which I found in the debugging mode “1;#SP-SERV\\kiran” (here I have added user Kiran). When I have added my name it looks like “16;#SP-SERV\\Himadrish Laha“. String represent is kind of <UserID>;#<UserLoginName>.More difficult for you to work.

People Or Group Field Value

People Or Group Field Value

Read more…

February 15th, 2010 | Categories: Troubleshoot Issues | Tags:

Followings are the kind of deployment issues in the SharePoint box. The scenario is in the test box, the solution is build free but once you try to deploy the solution, you may get the errors like below:


1.  Attempted to perform an unauthorized operation.

2. Error    1    Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
Cannot insert the value NULL into column ‘Assembly’, table ‘WSS_Content.dbo.EventReceivers’; column does not allow nulls. INSERT fails.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.
The statement has been terminated.        0    0

How to resolve this kind of errors. For the first one i.e.  Attempted to perform an unauthorized operation, this is kind of authorization issue. It simply define you don’t have adequate privilege for deployment though you are the administrator of the local machine as well have the fullest privilege in the SharePoint. Read more…

January 26th, 2010 | Categories: Configurations, Customization, SharePoint | Tags: , ,

Productive reports are always welcome. Management always appreciates you to build up a good informative report. In SharePoint, you can found a large area where organization can play with their business data and transformed the raw data to a informative and intelligent report.

From the ancient stage, we are following the process to transformed business data to generate report. Latter stage we have got many tools like SQL DTS and then we have got another feature, cubical concept. There are many product available in the market for generate business intelligent report and one of them from SQL Server Analysis Service suite from Microsoft.

In Microsoft SQL Analysis service, you can build up cube by executing the raw SQL and you can buildup cube. Next phase is to build up report using VS.NET report server project template and using those cube and build up the .rdl compiled file. I’m not going to drill down that much of detailed describing how to build up the .rdl file, instead of, I’m assuming those files already has been deployed in the SharePoint Document Library and we just need to configure properly those files into SharePoint.

Read more…

December 16th, 2009 | Categories: Troubleshoot Issues | Tags:

In this article, I will discuss another common error in MOSS 2007 and why that happens. Mostly developers are facing this error. Or it might be raised due to copy and move pages within site collection.

In MOSS 2007, there is in built capability to copy pages from one location to another location. Let’s say you have a SharePoint site collection and inside that collection there are multiple sub sites. And you want to copy a few pages (any page containing web part like report viewer) from one sub site to another sub site. Probably you want to reduce the development effort for the re-work (i.e. create the web part/layout pages in SharePoint designer add the web part etc).

Read more…

December 12th, 2009 | Categories: Customization, SharePoint, Solutions, WSS 3.0 | Tags: , , ,

Today, I’m going to demonstrate one useful and simple custom method against SPList object which could be reusable in other SharePoint applications. The objective is to verify whether any item is exist in the existing SharePoint list. And if the item is not exist in the SharePoint list, let an entry of the new inserted ListItem into that list.

If we sync our objective with SQL, the SQL logic would be: SELECT Count(FieldName) FROM SPList WHERE FieldName=’value’.
Using SPList or SPListItem objects, we are not supposed to implement the same using existing method and properties.  So let’s start to create the method GetRowCountByField() where we can pass the parameter in some dynamic nature. Below the detais of the parameter objects. Please note, while passing the filedName, we need to pass the internal filed name of the SPList object.
_ReferList: SPList object. This GetRowCountByField() method will be execute the query statement on top of this List object.

FieldInternalName:    SPList object’s field internal name.

FieldType: SPList object’s field type i.e. CHOICE/Number/String etc.

FieldValue: Simple value of that field which is using in WHERE clause in the query object.

Read more…

December 5th, 2009 | Categories: Troubleshoot Issues, WSS 2.0 | Tags: ,

Another common problem in WSS environment is unable to edit file from document library. Many times it has been found that end user is having adequate access to the Shared document library and they supposed to edit the file by clicking the edit menu. However while clicking on the edit-item drop down menu, nothing happens and user not able to edit the file. In other words they are not able to work on the file except reading.

Workaround option is download edit and uploads. But that is not the best way to resolve. As on initial starts the following steps need to be performed first

To check whether SharePoint site is under trusted site list in IE:
•         Open IE
•         Click on tools >> Internet Options
•         Click on security Tab
•         Click on Trusted Sites
•         If your SharePoint URL (for example http://sharepoint.microsoft.com) is not display on the web site list, then you need to add the url (i.e. http://sharepoint.microsoft.com) on the text box, and click then to ADD button to add this URL to your trusted site.
•         Click Ok to save this

Read more…

We can assume many things in life, but not everything match with our assumption. Similar story with SPList.Fields properties. Fields is a properties of the SPList objects which actually returns the SPFieldCollection object which also basically inherited  from SPBaseCollection.
From .NET perspective, we can use indexer or name to get the actual Field object from the collection of object. So let’s say we have a SharePoint list name CLIENT and there are column fields client and Title.

Now, let’s say we want to check the name of the client with the passing value in the list while updating the list. In other words, we have a variable name Client which holds the static value, which we need to check while iterating within the list. Below the simple code to get the same:

Read more…

November 25th, 2009 | Categories: Customization, SharePoint, WSS 3.0 | Tags: , ,

This is very common requirement in web world to open any link in a new window. The simplest approach is to use JavaScript to implement same. The same is applicable in SharePoint as well. There are different gateways you can implement JavaScript in SharePoint pages. You can use master page, layout page or any OTB component for the same. Every way has some pros and cons. However the simplest way is to use SharePoint OTB web part i.e. Content Editor web part.
The advantage of using Content Editor web part is that you can easily integrate it in any SharePoint pages by just adding this from the OTB web part gallery. You have option to hide this content editor web part as well. Once hide, end user not able to see the content editor control inside the pages, however the script/code actually work as expected.
Read more…

November 23rd, 2009 | Categories: Troubleshoot Issues | Tags:

Last week, while developing another small integration in SharePoint, I face one error saying “The Web application at http://< SharePoint URL> could not be found. Verify that you have typed the URL correctly”.

Everything was running perfectly the day before, but suddenly this problem appears. I was so surprised to see this. The code was to integrate event handler in SharePoint and trap those events and execute the different methods.

While goggling, I found the MSDN post http://social.msdn.microsoft.com/forums/en-US/sharepointdevelopment/thread/4ddafbb3-de1d-4356-a60a-11117a6dccd4 by Paul Galvin and Paul face the exactly same issue earlier. The error is given below:

“The Web application at http://<SharePoint URL> could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.”:null}
Read more…

November 19th, 2009 | Categories: SharePoint 2010 | Tags:

It’s a long waiting for SharePoint practitioner and officially SharePoint 2010 beta has been published at Microsoft Tech net site. Just after a month after the SharePoint preview the SharePoint 2010 beta is placed for download and below the links for download the products:

http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx
http://technet.microsoft.com/de-de/evalcenter/ee388573.aspx (for German)

Few things need to check like whether your system meets minimum requirements http://technet.microsoft.com/en-us/library/cc262485(office.14).aspx or if you have Windows 2008 R2 then whether you have applied the WCF hotfix http://go.microsoft.com/fwlink/?linkID=160770 etc.
Read more…