Programmatically changing promoted field on Sharepoint - InfoPath Dev
in

InfoPath Dev

Programmatically changing promoted field on Sharepoint

Last post 11-02-2011 12:32 AM by proudestmonkey. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 12-09-2010 05:46 AM

    • Jarecki
    • Not Ranked
      Male
    • Joined on 02-09-2010
    • Gliwice, Poland
    • Posts 25

    Programmatically changing promoted field on Sharepoint

    Hi,

    I promote a few fields while publishing Infopath template to server.

    Is there any way to edit single promoted field via Sharepoint (programmatically) without downloading entire xml and saving it back?

    I'm using this solution: http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields 

    regards Jarecki

     

  • 12-09-2010 06:55 AM In reply to

    Re: Programmatically changing promoted field on Sharepoint

    Hi Jarecki!

    That StackOverflow post is just silly. Some dev no doubt. You don't need code. Just turn on "property demotion" in 2007 or 2010 (when you publish your form, it's the same dialog that you use to specify field to promote to a SharePoint library). If you have 2003, you can still specify demotion manually but it's more of a hassle (let me know if you have 2003).

    Anyway, once you have specified "property demotion" you can add a datagrid view to your SharePoint form library and change the values via that. No need to open InfoPath.

    Best!

    Patrick Halstead
    Project Manager at Qdabra
  • 12-10-2010 12:03 AM In reply to

    • Jarecki
    • Not Ranked
      Male
    • Joined on 02-09-2010
    • Gliwice, Poland
    • Posts 25

    Re: Programmatically changing promoted field on Sharepoint

    Thank you Patrick for reply!

    In my scenario user fills in form, signs it digitally and clicks button 'Send'. Then webservice is invoked,

    some of data is saved to database (from dataset) and at this moment I want to modify one of fields in my

    form (saved on SP and from webservice level!). Promoted fields are marked as read only and I don't wan't 

    them to be changed by user manually.

    Solution from stackoverflow works fine for me but is slow (get forms contents, parse, modify, upload).

    I'm searching for something like this: open SP site -> open form library -> open form -> edit SP field

    (automatically update infopath form contents). I have tried to edit in this way, but it doesn't work for fields

    connected with Infopath form.

     

    regards Jarecki

  • 12-10-2010 01:54 AM In reply to

    • Jarecki
    • Not Ranked
      Male
    • Joined on 02-09-2010
    • Gliwice, Poland
    • Posts 25

    Re: Programmatically changing promoted field on Sharepoint

    SPListItem item = ...

    Works fine:

    item["Name"] = "new name"; item.Update();

    For promoted field, doesn't work:

    item["Semester"] = "10"; item.Update();

  • 12-10-2010 01:54 AM In reply to

    • Jarecki
    • Not Ranked
      Male
    • Joined on 02-09-2010
    • Gliwice, Poland
    • Posts 25

    Re: Programmatically changing promoted field on Sharepoint

    SPListItem item = ...

    Works fine:

    item["Name"] = "new name"; item.Update();

    For promoted field, doesn't work:

    item["Semester"] = "10"; item.Update();

  • 11-02-2011 12:32 AM In reply to

    Re: Programmatically changing promoted field on Sharepoint

    Hi Jarecki, Did you ever find a solution for this? I am facing a similar prospect of having to update InfoPath promoted fields in SharePoint lists and I will need to do it programatically so that I can update multiple files with values in say a CSV file.
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.