Add item to list, open with content type - InfoPath Dev
in

InfoPath Dev

Add item to list, open with content type

Last post 01-10-2007 01:27 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-09-2007 05:30 AM

    Add item to list, open with content type

    For example in my document library I have my form template as content type for it.
    When I add an item in this library within the following code:

    SPLists.Lists lists = new Lists();
    ...
    ...
    XmlDocument doc = new XmlDocument();
    XmlElement updates = doc.CreateElement("Batch");
    updates.InnerXml = "<Method ID='1' Cmd='New'>" +
    "<Field Name='ID'>1<Field>"
    "</Method>";
    XmlNode node = null;
    node = lists.UpdateListItems(listName, updates);


    , item created seccesfully. But I want to open this item in my form template...
    Need I write something like this "<Field Name='ContentTypeId'>NameOfMyTemplate<Field>", or what should I do ???
    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
  • 01-10-2007 01:27 AM In reply to

    Re: Add item to list, open with content type

    Hi Ekzarov,
    Your XML looks wrong. Field needs a closing tag. Also, you'll have to add a bunch of Processing Instructors to get it to open in InfoPath. The form template name, etc. Save an XML from InfoPath and open it in notepad to see the info it adds. This is also documented in the SDK I think.
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.