Expose Mandatory property - InfoPath Dev
in

InfoPath Dev

Expose Mandatory property

Last post 01-23-2006 01:47 PM by qwer. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-16-2006 04:27 PM

    • qwer
    • Top 500 Contributor
    • Joined on 10-03-2005
    • Posts 49

    Expose Mandatory property

    Hi all,

    Does anyone know how to check whether a data field is mandatory by code?

    Thanks
  • 01-17-2006 06:33 PM In reply to

    Re: Expose Mandatory property

    Hm, haven't tried this before - try this out:

    var oNode = XDocument.selectSingleNode( "my:myFields/my:field1" );

    var oMinOccurs = oNode.selectSingleNode( "@minOccurs" );

    if( oMinOccurs.text == "1" )
    { /* node is required */ }


    Also, if that doesn't work you could try using oNode.getAttribute( "@minOccurs" ). Like I said, I haven't tried this, but it seems like it should work.

    ---------------
    Matt Faus
    InfoPath Dev Texas
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 01-23-2006 01:47 PM In reply to

    • qwer
    • Top 500 Contributor
    • Joined on 10-03-2005
    • Posts 49

    Re: Expose Mandatory property

    MFaus,

    I have tried the ways you mentioned, but have no luck. Perhaps I am not doing it right. I am using VBScript, would there be any difference?
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.