XPath in Infopath

B

blain

I'm not sure where else to post this, but it is office scripting so maybe
someone here could help. I apologize for tainting a vba group with js. ;)

I'm having some issues in the scripting with infopath that seem like they
should be quite simple. ANy help would be appreciated.

On my first form I only had one data source (Main)
and used the following code to set my file name prior to a save

meetingName = XDocument.DOM.selectSingleNode( "//my:field1" ).text;
meetingDate = XDocument.DOM.selectSingleNode( "//my:field2" ).text;
XDocument.UI.SetSaveAsDialogFileName(meetingDate + " - " +
meetingName);

Very simple...

Now on a new form I've got two data sources, again the field I'm trying
to use is simply a text box on the main form, but I just cannot get the
syntax correct. Name of the field is "UseCaseName"

I've tried:

docName = XDocument.DOM.selectSingleNode( "//my:UseCaseName" ).text;

I've tried it many different ways but simply cannot reference it, if I
navigate to it using the expression control that field is shown as
"my:UseCaseName"

But everytime I run this I get that the object cannot be found.

Please help, I know it is something ridiculously simple...
 
C

Cindy M.

Hi =?Utf-8?B?YmxhaW4=?=,
I'm not sure where else to post this, but it is office scripting so maybe
someone here could help. I apologize for tainting a vba group with js. ;)
Have you tried asking in the InfoPath newsgroup :)?
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=mi
crosoft.public.infopath&cat=en_us_a47a141c-dc08-4133-bd75-ef921ef1aa6e&lang=e
n&cr=us

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top