FormID property? - InfoPath Dev
in

InfoPath Dev

FormID property?

Last post 12-27-2006 05:55 AM by ekzarov. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-04-2005 06:36 PM

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

    FormID property?

    Hey people,

    Would anyone know how to expose the currently opened formID and form name programmatically (in scripts plz if possible)?
  • 12-04-2005 10:11 PM In reply to

    Hi,

    look at this:http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=607

    Regards,

    Franck Dauché
    InfoPathDev
  • 12-05-2005 01:10 PM In reply to

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

    Unfortunately this is not what I am looking for. XDocument.URI merely exposes the the name of the file that is currently opened (eg, Form1). What I am really after is the Form name (eg, Travel Request) and Form ID (eg, urn:company:Travel-Request).

    I know that once I can expose the form name I won't need the form ID one because the prefix of my form ID will always be the same for my company. I would think this is a pretty simple property for Microsoft to include. Is there a way?
  • 12-05-2005 09:06 PM In reply to

    Hi Qwer,
    You'll want to use XDocument.Solution.DOM and query it for xsf:xDocumentClass. Then you can get @name which "provides a unique, Uniform Resource Name (URN)–based name for the form that the .xsf file defines." This is all documented in the SDK which is a great read. If you haven't looked at it, please install the InfoPath SDK and have fun!

    function SolutionInfo::OnClick(eventObj)
    {
    var objSolution = XDocument.Solution;
    var strSolutionVersion = objSolution.Version;
    var objNameNode = objSolution.DOM
    .selectSingleNode("xsf:xDocumentClass/@name");
    var strNameText;

    if (objNameNode != null)
    strNameText = objNameNode.text;
    else
    strNameText = "Name not available.";

    XDocument.UI.Alert("Version: " + strSolutionVersion +
    "\nName: " + strNameText);
    }



    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 12-27-2006 05:55 AM In reply to

    Is there a posibility to do the same, but for Library ID of the form ?
    Best regards,
    Alexander Ekzarov
    Kyiv, Ukraine
    silverlightnet.blogspot.com
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.