Update a Forms Library field - InfoPath Dev
in

InfoPath Dev

Update a Forms Library field

Last post 12-30-2008 12:36 AM by swathip. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-19-2008 12:23 PM

    Update a Forms Library field

    Hi

    I am trying to update a field in my Forms library. It works fine, do not give any error but does not update the field. I am also an administrator on the server with full access This is my code :

    using (SPSite site = new SPSite("http://server:10746"))
                   
                    {
                        using (SPWeb web = site.OpenWeb())
                        {
                            SPList surveylist = web.Lists[<Forms Library>];
                       
                            //Name of the field as in list settings
                            string ColumnName = GetInternalName("Location Sequence", surveylist);

                            string camlQuery = "<Where><Eq><FieldRef Name='" + ColumnName  + "'/><Value Type='Integer'>"+ currentLocationSequence +"</Value></Eq></Where>";

                            SPQuery sharepointQuery = new SPQuery();
                            sharepointQuery.Query = camlQuery;
                            SPListItemCollection surveys = surveylist.GetItems(sharepointQuery);

                            foreach (SPListItem survey in surveys)
                            {
                                survey["Survey Status"] = 7;
                                survey.Update();
                                //surveylist.Update();
                            }

                        }
             }

    This code works fine without any error but does not update the value.

    Any suggestion or help is appreciated
    Thanks
    Sourav
  • 12-19-2008 01:53 PM In reply to

    Re: Update a Forms Library field

     Hi,

    As I am using a Forms Library and try to change the value of a promoted property column, I also tried 

    survey.Properties["{94c0bb55-0e52-4133-b242-882b2443de6c}"] = 7;

    in the above code but still no luck.

    Thanks
    Sourav
  • 12-19-2008 09:34 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Update a Forms Library field

  • 12-22-2008 03:16 PM In reply to

    Re: Update a Forms Library field

     Thnaks Shiva !

    I am also doing the same thing as in the link u reffered. I think its a limitation with promotion properties in an infopath forms library because when I try to update the any column which is not promoted column, same code works fine.

    Seems some error or limitation with Forms Library in MOSS.

     

    Thanks
    Sourav
  • 12-30-2008 12:04 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Update a Forms Library field

    Hello,

    Thank for your reply. Did you exceed the limitation of promoted list properties in your form? Can you give more detail on your error message?Hello,

    Go through the below link to get more information on Xdocument,

    http://msdn.microsoft.com/en-us/library/bb229879.aspx

  • 12-30-2008 12:36 AM In reply to

    Re: Update a Forms Library field

    Hi,

    As of my knowledge there is a limit for the promoted properties in the SharePoint library. I do not know the exact number but it will accept around 75 to 80 columns.

    Swathip
    www.ggktech.com
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.