Using Form Options Open Save - InfoPath Dev
in

InfoPath Dev

Using Form Options Open Save

Last post 02-03-2011 06:05 AM by KaSper. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-01-2005 12:25 PM

    Using Form Options Open Save

    Trying to utilize the script option for Open Save within Form Options to pre-fill the save path and file name
    In particular I want to set the SaveAsDialogFilename with the contents of 2 fields concatenated together. Code below generates errors.

    DIM GMSRef;
    GMSRef = XDocument.DOM.selectSingleNode("my:myFields/group3:Date");
    UI.SetSaveAsDialogLocation("c:/test");
    UI.SetSaveAsDialogFileName(GMSRef);

    Replacing
    UI.SetSaveAsDialogFileName("xyz") pre-populates form with xyz as file name

    any ideas on how to get this to work.
  • 12-02-2005 01:38 AM In reply to

    Re: Using Form Options Open Save

    Hi Kssandhu and welcome to our forum,
    This is easy. I've asked Agni to respond.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 12-02-2005 09:36 AM In reply to

    Re: Using Form Options Open Save

    Hi,
    You are passing the node instead of string value to SetSaveAsDialogFileName.

    Code should be
    GMSRef = XDocument.DOM.selectSingleNode("my:myFields/group3:Date");
    XDocument.UI.SetSaveAsDialogLocation("c:\\test");
    XDocument.UI.SetSaveAsDialogFileName(GMSRef.text);

    Hope this code works for you!

    Agni
    InfoPath Dev India
  • 12-02-2005 11:40 AM In reply to

    Re: Using Form Options Open Save

    I now get an Object Required error. I am using Jscript in case that makes a difference.
  • 12-02-2005 12:35 PM In reply to

    Re: Using Form Options Open Save

    That means that with your query statement you are not retrieving the node. Your XPath looks a little screwy, try something more like this:

    GMSRef = XDocument.DOM.selectSingleNode("/my:myFields/my:group3/my:Date");


    ---------------
    Matt Faus
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 12-03-2005 05:33 AM In reply to

    Re: Using Form Options Open Save

    That solved it. Thanks
  • 02-03-2011 06:05 AM In reply to

    • KaSper
    • Not Ranked
    • Joined on 02-03-2011
    • Posts 1

    Re: Using Form Options Open Save

    Please,help me! I have error :Object required How can I fix the problem? Code: function XDocument::OnSaveRequest(eventObj) { var Order = XDocument.DOM.selectSingleNode("/my:myFields/my:OrderNr"); XDocument.UI.Alert(Order.text); if (XDocument.IsNew == true || eventObj.IsSaveAs == false) { if (eventObj.IsSaveAs == true) { XDocument.UI.SetSaveAsDialogFileName(Order.text); } eventObj.IsCancelled = eventObj.PerformSaveOperation(); } eventObj.ReturnStatus = true; }
    Filed under:
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.