qRules command not firing for calendar control - InfoPath Dev
in

InfoPath Dev

qRules command not firing for calendar control

Last post 01-13-2014 02:27 PM by TomRenfro. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 01-13-2014 01:40 PM

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

    qRules command not firing for calendar control

    Hi, I'm developing a form that should do a calculation using DateDiff.  Some preliminary information:  the form is injected with qRules, but is also Full Trust and using code, specifically C# code on a button click event.

    Here is how my rule is defined:  it's on the calendar control, based on a field with a Date datatype.  The condition is to execute when the field changes.  I'm setting the qRules data source Command field to concat("DateAdd /xpath=/my:RequestForTimeOff/my:LeaveRequested/my:BeginDate /", UnitType, "=", NbrUnits) where UnitType is either hours, days, or weeks, and NbrUnits is an integer.  The command is defined in the formula builder window of the value field.  The command is intended to populate another date field with the results, as in "Set a field's value: EndDate = Result", result from the qRules data source.

    The problem is when I test in Preview mode, the rule doesn't appear to execute.  I've dragged the Success, Result, and Error fields onto my view and nothing appears.

    What might I be missing?  Can qRules not be used when code is in the form?

  • 01-13-2014 01:51 PM In reply to

    Re: qRules command not firing for calendar control

    Hi Tom,

    qRules cannot be injected into forms with code using the qRules Injector. Instead, the qRules DLL must be added via the steps in this document:

    http://www.infopathdev.com/files/folders/qrules/entry56111.aspx

    Hope this helps!

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


  • 01-13-2014 02:01 PM In reply to

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

    Re: qRules command not firing for calendar control

    Thanks Ernesto.

     Do I need to remove any injected data source?

  • 01-13-2014 02:10 PM In reply to

    Re: qRules command not firing for calendar control

    Hi, Tom - you can leave the injected qRules data source & XML instead of manually adding them as per the instructions for combining code & qRules.

    Hilary Stoupa

  • 01-13-2014 02:27 PM In reply to

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

    Re: qRules command not firing for calendar control

    Hi Hilary and Ernesto,

    Too late, jumped the gun and took them out!  It works anyway.

    I'm just getting my command down cold for using a base of 8 hours to represent a work day.  I'll get it figured out from the doc.

    Thanks again.

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