Browser forms and managed code - InfoPath Dev
in

InfoPath Dev

Browser forms and managed code

Last post 01-17-2014 04:41 AM by Jimmy. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-16-2014 09:46 AM

    • TomRenfro
    • Top 75 Contributor
      Male
    • Joined on 09-29-2011
    • Oklahoma City, OK
    • Posts 134

    Browser forms and managed code

    I'm developing a form that gathers date sensitive data from the user, runs a set of rules for calculating hours, days between, etc. using qRules, then if a button is clicked, the form creates a vCalendar file using existing form data.  This allows the user to save to their Outlook calendar.  This all works well in Preview mode, and the form is published as full trust on the server.

    The problem I'm experiencing is twofold:

    1. qRules seems to fire its rules out of order on the browser version.  Calculations that should fire when a field changes don't fire until the button is clicked.
    2. The code that writes and opens the vCalendar file now can't navigate the folder location, I'm assuming it's due to permissions being different on the server than the client

    What can I do to ensure the rules fire in the same order as the client and is it possible to write, open, then delete the vCalendar file on the local machine of the user from a browser based form?

    Thanks in advance.

  • 01-16-2014 10:17 AM In reply to

    Re: Browser forms and managed code

    I've seen the issue you describe when the Postback settings are not set to Always. So the rules on the field change are "in line" to execute, and when you click the button, the postback happens, and those rules execute. As you say, it seems like the logic is happening out of order. Can you check the postback settings are set to Always on any control that calls a qRules command? Thanks.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 01-16-2014 10:28 AM In reply to

    • TomRenfro
    • Top 75 Contributor
      Male
    • Joined on 09-29-2011
    • Oklahoma City, OK
    • Posts 134

    Re: Browser forms and managed code

     Yes, that did the trick for the calculations.  Any ideas on the vCalendar file creation?  Do you need the code?

  • 01-16-2014 01:44 PM In reply to

    • TomRenfro
    • Top 75 Contributor
      Male
    • Joined on 09-29-2011
    • Oklahoma City, OK
    • Posts 134

    Re: Browser forms and managed code

     I also played with directly creating a calendar item using the Microsoft.Office.Interop.Outlook .NET reference, and it works in Preview mode.  I'm not sure it would work for a browser form though. 

    Can I get a verification on that, and alternatives if this approach won't work for the browser?

  • 01-16-2014 02:07 PM In reply to

    Re: Browser forms and managed code

    Hi - if your code is accessing the local file system - once opened in the browser, I'd imagine that code is trying to access the local file system on the server. I don't know of a way you will be able to access the user's local file system from a form running in the browser - I'll ask Jimmy if he knows.

    Hilary Stoupa

  • 01-17-2014 04:41 AM In reply to

    Re: Browser forms and managed code

     Hi Tom,

     Yes, Hilary's assessment is correct. An InfoPath browser form's managed code runs on the server so if it can access any file system at all, it would be the server's file system. The same would apply for any other Interop code that might interact with Office applications. I'm afraid I don't know of any alternatives for creating calendar items from browser forms, but if it were possible, I'd imagine it would have to involve some service that creates the calendar item on the mail server rather than directly on the user's machine.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.