qRules 4.2 and useBrowserApi node - Hilary Stoupa
in

InfoPath Dev

Hilary Stoupa

qRules 4.2 and useBrowserApi node

We are getting ever closer to releasing qRules 4.2 and I wanted to post briefly on a new node we've added to the QdabraRules data source - it is called useBrowserApi and has a default value of "false".

Here's what it does and why it is there:

With qRules 4.1, we modified a lot of the SharePoint related commands to use the SharePoint object model instead of web services if the form was opened in the browser. We added a node called useWebServices, just in case this change affected any forms upgraded from earlier versions of qRules. But the other day, we suddenly saw an issue where sometimes qRules was not correctly switching between the SharePoint object model code and the web service code, and this caused some issues in our Office 365 forms (which can't fall back on using web services).

That code has been addressed in 4.2 and we are now unable to reproduce the issue in our environments, however, it made sense to give form designers a way to switch this off and indicate that they would like to always use the SharePoint DLLs

Now, if you ever have issues with a form failing in the browser because it is not using the SharePoint object model, you can set useBrowserApi to true in order to make the form always use the SharePoint object model based code.

The logic, then, as of qRules 4.2, is as follows:

  1. If the useBrowserApi node in qRules data source = true, we use the SharePoint DLLs.
  2. If not 1, and if Application.Environment.IsBrowser = true or Application.Environment.IsMobile = true, we check to see if the useWebServices node in the qRules data source is true:
    • If useWebServices = true, we do NOT use SharePoint DLLs
    • If useWebServices = false, we DO use SharePoint DLLs
  3. If not 1, and if not 2, we do NOT use SharePoint DLLs

If useBrowserApi is set to true, the SharePoint commands like SubmitToSharePoint will fail in Filler and in Preview - unless the form is opened on a machine with SharePoint installed, of course.

Comments

No Comments

About Hilary Stoupa

I wandered into development after working as a business process analyst for a global manufacturing company. I create InfoPath solutions for our clients as well as work as a developer on company tools that extend InfoPath. I've also been instrumental in creating the InfoPath Master Class training provided by Qdabra.

Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.