How can I determine if form is running in filler(preview) or as web page? - infopath 2010 - InfoPath Dev
in

InfoPath Dev

How can I determine if form is running in filler(preview) or as web page? - infopath 2010

Last post 12-07-2015 05:38 AM by rayzermatic. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 12-03-2015 06:15 AM

    How can I determine if form is running in filler(preview) or as web page? - infopath 2010

     Hi,

    I have started tracking all of my forms usage using a quick post to a SQL server via a web service I've created. This way we can run an analysis on all the form activity.
    It tracks Open, Submit, Update, Completion and Errors along with the date-time, FormType, FormID, Form Version, UserID, FormStatus and the XML form filename that was created and saved on the server.

    I only want it to update the form activity log table when it's a web page running on the server and not when it's in development on my desktop and I am previewing it in filler.
    I currently have a field I set to true or false based on whether or not I want the form to post. All too many times, I go through the publish only to discover that I forgot to change the setting.

    MY QUESTION IS: Is there a way I can determine whether the form is running in filler or as a web page? If so, I can use that as an indicator whether or not to post to the activity log and save myself some headaches along the way.

    Thanks,

    Ray

     

  • 12-03-2015 12:28 PM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

    Only think I can think of is there are usually query params in a browser form that you can access via code that are not present when opened in the filler... but I can't think of anything out of the box that would tell you this, I'm afraid. I think the approach you have taken may be the best option... Maybe put a BIG expression box on the top of the form with conditional formatting to always hide (so you can see it in design mode only) reminding you to change that setting? Or - to really annoy yourself - show the expression box if the field = true. So if you open in the browser after publish, you'll have a nice big reminder? :)
    Hilary Stoupa

  • 12-04-2015 05:21 AM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

     Well... there you go.

     

    Another possible function for another installment of Qrules. :)

    Yeah, I've done the reminder already. That's how I discover I forgot to reset it after publish, as I usually click the "Open in Browser" link after publish to be sure I didn't introduce a goober that doesn't show in filler but shows up as a web page. 

     

    Thanks for the reply, Hilary, :)

     

    Ray

  • 12-04-2015 08:02 AM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

    Oh, qRules can do this - with the GetInputParameter command - are you already using qRules in this form?
    Hilary Stoupa

  • 12-04-2015 09:02 AM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

     some of the forms have the older Qrules in them. Some don't have any and one has the newer (one rev back I think)

     

  • 12-04-2015 02:09 PM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

    So - in a form w/ qRules, on the QdabraRules finishedLoading attribute, you could add a rule using GetInputParameter and use either SaveLocation (which I think is only present in a new browser form) or XmlLocation (present in an existing XML opened in the browser). If either key has a value, you'd know you were opened in the browser....
    Hilary Stoupa

  • 12-07-2015 05:38 AM In reply to

    Re: How can I determine if form is running in filler(preview) or as web page? - infopath 2010

    Thanks a billion, Hilary!

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