qRules Datediff 101 please. - InfoPath Dev
in

InfoPath Dev

qRules Datediff 101 please.

Last post 11-06-2012 03:00 PM by wapfunz. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-06-2012 02:27 PM

    qRules Datediff 101 please.

    Even using a virtual machine to isolate myself from the corporate cloud server - I cannot open the sample qRules Form, the dash board etc, only getting templ;ate is not secure requires digital signing and or full trust.

    Having said all that I can inject qrules into a form from the virtual machine and gain access to them in the ordinary world.

    I have and am reading qRulesv4.2 user guide:

    I have a list of holidays on the server.

    I have qrules injected into a leave form.

    I have three fields: startdate, EndDate, datediff on a form.

    I have rules to set a fields value (datediff) if start and end date are not blank - that is where the qrules datediff comes into play - I hope.

    So when I set the action = set a fields value

    Field = Command (from qRules secondary datasource?)

    Value = now here is the tricky part for me - do I type in DateDiff or use the example of typing in along the lines of Concat("DateDiff / date1="startdate, /date2="fieldWithDateTosubract", /... /dsnamehol= url to list).

    If one of the columns in the list has the dates as dd/mm/yyyy - how do I define that column in the use of DateDiff?

    Where does the answer go and how do I get it back to the field on my form?

    Useage 101 - I do apologise as I cannot find a post and I have read quite a few that will help me.

    Thank you to anyone willing and able to help me.

    Best Regards.

    Best Regards
    Bill
  • 11-06-2012 02:49 PM In reply to

    Re: qRules Datediff 101 please.

    Hi there - starting with the sample form - you can either install the form (it is full trust) prior to trying to open it, or you can find it in the default install location for qRules and right click and select design to open in design mode (which is more interesting anyway, since you want to know how the thing works). Default install location is: C:\Program Files\Qdabra Software\Qdabra Rules Library\Forms (for 64 bit machines, C:\Program Files (x86)\Qdabra Software\Qdabra Rules Library\Forms).

    You are going to need to create a data connection to your list of holidays.

    You will probably use a concat formula, since your date values are in fields. qRules just cares about the value the Command node gets set to, not how it gets set, so you'll have something like:

    concat("DateDiff /date1=", dateField, " /date2=", otherDateField, " /dsnamehol=NameOfYourListDataConnection /xpathhol=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:HolDate")

    You need to be careful about spaces, slashes, commas and what not, the syntax is particular. Take a look at the sample form in design mode & it should help you out...

    Hilary Stoupa

  • 11-06-2012 03:00 PM In reply to

    Re: qRules Datediff 101 please.

    Hilary you are a joy to be sure.

    Thank you. Gratitute and appreciation.

    I can only open in design mode in the virtual machine as the corp IT would only allow it to work and install in the virtual machine. Success that I can open it - and gratitude to your wonderful and very timely help.

    Thank you for the clear and instructive response - makes sense finally to me, And one of your posts "Where ever you start the rule that runs the command, follow that rule with a rule to action that sets your field to the value of the result field" resolved the get the answer to the form.

    I can see light now.

    Thank you

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