Access node in code. Should be easy, but... - InfoPath Dev
in

InfoPath Dev

Access node in code. Should be easy, but...

Last post 10-31-2007 10:06 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-08-2007 07:18 AM

    Access node in code. Should be easy, but...

    I'm trying the following code to set a field named Editor:

                        Me.MainDataSource.SetNamedNodeProperty(myXNav, "/ns3:myFields/ns3:MJQualityIndicator", Application.User.UserName.ToString)

     The problem is "/ns3:myFields/ns3:MJQualityIndicator" is returning an invalid argument error.
     

    Heres the document

    <?xml version="1.0" encoding="UTF-8"?>
    <?mso-infoPathSolution solutionVersion="1.0.0.1087" productVersion="12.0.0" PIVersion="1.0.0.0" href="file:///C:\Users\chauvinr.MJSC\AppData\Local\Microsoft\InfoPath\Designer2\813317f2c6347ce\manifest.xsf" language="en-us" ?>
    <?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.2"?>
    <ns3:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:ns1="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-05T14:10:19" xmlns:ns3="http://schemas.microsoft.com/office/infopath/2003/my/2006-01-05T14:10:19" xmlns:tns="http://mjsc-int.com" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:_xdns0="http://schemas.microsoft.com/office/infopath/2003/changeTracking" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:ns2="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" xmlns:ns4="urn:mdWebService" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-01-03T22-13-40" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003">
        <ns3:MJEnterpriseID>  2007-08-08T10:12:35</ns3:MJEnterpriseID>
        <ns3:MJEnterpriseIDRelatedMaster></ns3:MJEnterpriseIDRelatedMaster>
        <ns3:MJEnterpriseLastReviewDate></ns3:MJEnterpriseLastReviewDate>
        <ns3:MJEnterpriseStatus></ns3:MJEnterpriseStatus>
        <ns3:MJPrivate></ns3:MJPrivate>
        <ns3:MJQualityIndicator></ns3:MJQualityIndicator>

        <ns3:AutoResolvedWinner></ns3:AutoResolvedWinner>
        <ns3:HasPicture></ns3:HasPicture>
    </ns3:myFields>

    /bac
    Filed under:
  • 10-31-2007 10:06 AM In reply to

    Re: Access node in code. Should be easy, but...

    SetNamedNodeProperty() is being used incorrectly.

    The parameters are: (NodeToWhichThePropertyWillBeSet, NameOfProperty, ValueOfProperty)

    You are placing an XPath in the second parameter which is not a valid property name. The first parameter needs to be a valid node.

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