Chanaka

July 2009 - Posts

Update field values of Infopath form library Programatically

SPSite objSite = new SPSite("http://sharepointsvr:123/");
SPWeb objWeb = objSite.RootWeb;
SPFolder oFolder = objWeb.GetFolder("Participant");
SPFileCollection collFiles = oFolder.Files;

objWeb.AllowUnsafeUpdates = true;


foreach (SPFile oFile in collFiles.Folder.Files)

{

SPListItem oListItem = oFile.Item;

oListItem.File.CheckOut();

oListItem["ProgramaticField"] = "Chanaka has done it";

oListItem.SystemUpdate();

oListItem.File.CheckIn("chana did");

}

 

NB:-

(1) We Cant use this method under "SPSecurity.RunWithElevatedPrivileges(delegate.."

(2) If we want to edit a field that is filling from infopath form we have to use

oListItem["Fld_x0020_Other_x0020_Names"]   instead of oListItem["ProgramaticField"]

 

Sharepoint 2010 new features

  • Look & Feel (Ribbon Control)
  • Multi document Checkout + avoid from post backs
  • Nice pop-up windows than response.redirects :)
  • Direct uploading & showing images from your computer to sharepoint
  • SilverLight webpart
  • Nice themes like "PowePoint Theme"
  • Visio services running with sharepoint services (Visio is not necessary)
  • Fully rich Sharepoint Designer
  • Entities to connect SQL,LOB with Edit/Delete functions (OOB)
  • Direct connect to the office tools like Office 2010 with a click :)