Pages

Sunday, July 26, 2009

Error: Invalid data has been used to update the list item. The field you are trying to update may be read only.

I was getting error “Invalid data has been used to update the list item. The field you are trying to update may be read only” when I tried to update list items with incorrect value into People and group field, I was taking value from SharePoint People picker web control and update same values into SharePoint List columns.

Actually we need to pass and assigned value into specific format to people and group data type, below link describes very good and precise information on how to get values from SharePoint people picker control and update into list columns having people data type.

http://dishashah.wordpress.com/2009/06/18/how-to-display-users-to-sharepoint-peoplepicker-and-to-get-data-from-sharepoint-peoplepicker/

Enjoy!!

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

I have written web service program to fetch all list names from web application, in that case I was getting access denied error while retrieving Title of SPWEB object.

Error:


at Microsoft.SharePoint.SPGlobal.HandleUnauthorizedAccessException(UnauthorizedAccessException ex) at 'SPWEB.Title' threw an exception of type 'System.UnauthorizedAccessException'

I have found that my current user don’t have access rights to access some of the sites, after giving required access rights my web service program gave me correct output without any errors.

:)

Difference between Microsoft Virtual PC and Virtual Server

One day one of my friend asked me which tool are you using for SharePoint development, Is It Virtual PC or Virtual Server?

I told him, hmmm, till now I am using Microsoft Virtual PC 2007 but I thought that let me find out what is difference between Microsoft Virtual PC and Virtual Server, after doing some research I have found out that basically Virtual PC is designed for desktop PC in which Windows XP operating systems running and Virtual Server designed for server PC in which Windows Server 2003/2007 or any server operating systems running.

Another main difference I have found was, in Virtual PC we can’t connect or access one Virtual PC to another PC, but if we have Virtual Server setup into our LAN then we can connect and access all Virtual Servers.

Extensions for Virtual PC files:

Virtual machine configuration files are .VMC files,
Virtual hard disk files are .VHD files
Virtual PC saved state files are .VSV files


Reference Links:


http://blogs.technet.com/megand/pages/271852.aspx : Brief and very good difference between Virtual PC and Virtual Server

http://blogs.technet.com/keithcombs/archive/2007/06/27/vmrcplus-goes-public-download-now.aspx : Download link for VMRPlus client (VMRPlus for running virtual server)

Monday, July 20, 2009

How to open InfoPath form library into new browser window

I have found many alternatives to open InfoPath form into new window, one of them would be to take InfoPath form link URL and put same URL into summary link web part or page viewer web part.

Reference Link:

http://www.infopathdev.com/forums/p/10464/37554.aspx

Error while updating SharePoint list, “The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again”

This error "The security validation for this page is invalid. Click Back in your Web browser, refresh the page, and try your operation again" is very common for beginners SharePoint developer, who start developing and digging into SharePoint object model, it’s coming while updating SharePoint list, the cause of error is due to security rights, if we make web.AllowUnsafeUpdates = true and then update the SharePoint list then we won’t get above error.

Sample Code:

Web.AllowUnsafeUpdates = true;
item["Title"]=”Sample”;
item.Update();

Happy Coding !!

Error while updating list items "Cannot complete this action. Please try again."

I was getting error while updating list items; after looking into each code line by line, I have found that error comes due to incorrect syntax near CAML query, I feel that SharePoint didn’t give us good user friendly error message to debug into our code. After making correction, my code work well.

Enjoy!!

How to give intelligence into feature XML file

One day I was creating my feature file into solution package, at that time I saw that I didn’t get intelligence of all elements and attribute into my file and I have found that by adding below schema file, we will be having intelligence in any XML file. Though it’s very small things, but I thought to share with you.

Schema file:

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd"

Error while deploying solution “This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application”

I was getting error while deploying solution through STSADM command, error was This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application”

I have figured out that it’s giving me problem because of URL parameter into deploysolution STSADM command, after removing it from command, my solution package was working fine.

Reference Link:

http://snahta.blogspot.com/2008/08/this-solution-contains-no-resources.html