Hi,
I was successfully able to update one of the fields (which was of type boolean) from infopath for library item using sharepoint object Model as if it was a list item.
But for another field which is of type text, the same code just gets executed but does not change the field value !!!!
I am using following code, which works for that boolean field but for another field of type string , not sure why it is not workign. Any idea ?
SPSecurity.RunWithElevatedPrivileges(delegate()
{ SPWeb web;
SPSite site = new SPSite("http://sharepointsite"); web = site.OpenWeb();
SPList formLibList = web.Lists["FormLibraryName"];
SPQuery query = new SPQuery(); query.Query = "" + titleName + ""; web.Site.WebApplication.FormDigestSettings.Enabled = false;
web.AllowUnsafeUpdates = true; SPListItemCollection col = formLibList.GetItems(query);
if (col.Count > 0) {
col[0]["CustomerName"] = "test customer name"; col[0].Update();
}
web.Site.WebApplication.FormDigestSettings.Enabled = true; web.AllowUnsafeUpdates = false; });
Thanks,
Nikhil