Get field value out of form - InfoPath Dev
in

InfoPath Dev

Get field value out of form

Last post 07-03-2012 05:37 AM by DriesenMichiel. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-03-2012 05:13 AM

    Get field value out of form

    Hey,
    I have a problem with a form, i'm using code to add a row in a repeating table. But i want to set the row that's been added to a value of a field in the form.

    Here you see the code to add the row:

    string myNamespace = NamespaceManager.LookupNamespace("my");
    using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode(
    "/my:ProductSystemIdentification/my:group5", NamespaceManager).AppendChild())
    {

    writer.WriteStartElement("group6", myNamespace);
    writer.WriteElementString("field1", myNamespace, "comment1");
    writer.WriteElementString("field2", myNamespace, "comment2");
    writer.WriteElementString("field3", myNamespace, "comment");
    writer.WriteEndElement();
    writer.Close();

    Now instead of comment 1- 2 -3 I want a value from the form, how can i set a value from the form to a variable ?
    The values are located here: "my:ProductSystemIdentification/my:ProductAdmin/my:Version" and so on..

    It can't be that hard i think ? But i don't find the right solution, I tried some different options from the form but I always get errors.
    Can someone please help ? Thanks
    Filed under:
  • 07-03-2012 05:37 AM In reply to

    Re: Get field value out of form

    Never mind alreadt found it

    string fieldValue = MainDataSource.CreateNavigator().SelectSingleNode(
    "/my:ProductSystemIdentification/my:ProductAdmin/my:Version", NamespaceManager).Value;

    sorry for the post
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.