Help Using VBScript - InfoPath Dev
in

InfoPath Dev

Help Using VBScript

Last post 05-02-2008 01:30 AM by Jon_Smith. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-30-2008 08:52 AM

    Help Using VBScript

    Hey everyone,

     I am wanting to use the datediff code but I am completely confused by the Microsoft Script Editor, I taught myself coding using Visual Basic Code in Excel using the Visual Basic Editor and use that frequently but I can't get started with Microsoft Script Editor,

    would someone be kind enough to either point me in the direction of a full tutorial or be willing to give me a step by step guide,

    for example I will make a blank form with a Date1 field a Date2 field and a DateDiff field and would require step by step guide from there.

     

    Jon Smith

  • 04-30-2008 09:49 AM In reply to

    Hi Jon.

    In this thread i have attached a txt file with sample code.

    http://www.infopathdev.com/forums/p/5646/21172.aspx#21172

    You should be able to modify it to address your fields and schema or use it as a guide.

  • 05-01-2008 12:54 AM In reply to

    Thanks Clay Fox

    the problem is more that I am unsure where and how to put code into the microsoft script editor, it seems vastly different to visual basic editor which is what I am used to

     

    Jon Smith

    Edit-

    I Have now got my head around putting simple VB code into the script editor, but I am struggling with the referencing nodes as in like

    XDocument.DOM.selectNodes("//dfs:myFields/dfs:dataFields/d:WFPJob")

    I dont get the ("//dfs:myFields/dfs:dataFields/d:WFPJob") part, if I wanted to reference "Field1" in "Myfields" that I just made would it be ("//dfs:myFields/dfs:field1") or something like  ("//my:myFields/my:field1") as I have seen different examples but neither of them seem to work for me

     

    Jon Smith

  • 05-01-2008 06:56 AM In reply to

    If you have InfoPath 2007 you can actually right click a node in your data source and select Copy Xpath to get the exact syntax but this can be tough.

    Check you main data source. DFS is used on database type forms where the my prefix is the default.

    You also can extract the source files and open the manifest in notepad to see the XML.

  • 05-02-2008 01:30 AM In reply to

    I am still lost, I dont have 2007 so I can't copy the Xpath, and I am unsure exactly how to do the other stuff, I have attempted but cant find anything resembling  //my:myfields/ etc, could you explain how I check the main data source and how to extract the source files,

    sorry about needing to be spoon fed here.

     

    Jon Smith

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