qRules sort table - InfoPath Dev
in

InfoPath Dev

qRules sort table

Last post 06-29-2010 11:33 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-29-2010 06:27 AM

    qRules sort table

    qRules newbie attempting to use Sort Table command to sort repeating table.

    I've injected qRules and set the value of Command in Form Options rule (want the table sorted each time the form is opened), and noticed no change.  No error, no sort, nothing.

    Have tried tweaking the syntax a little, but not sure where the problem lies.

    Any assistance would be appreciated !   

  • 06-29-2010 06:39 AM In reply to

    Hello,

    As you craft the correct command to use, we recommend calling the action via a button and displaying the secondary data source nodes (such as the Error node) in the canvas. This will allow you to tweak the command until it works perfectly. Once verified, you can clean up the canvas and use the rule (command) in its final location.

    Let us know if doing this reveals any errors or additional details. Thank you.

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


  • 06-29-2010 08:54 AM In reply to

    Good advice.  Thanks.

    Still not doing anything.  My form now shows the version (2.2), finishedLoading (false), isSwappingDom (false), and Command (see below).  All others are blank.

    Here's my command: SortTable /row=my:myFields/my:NotesSection/my:group10/my:NotesTable /compare=my:NotesText

    Also, I'm currently sorting by a text field, but would prefer to use a date field.  What should I specify for "type" ?   Documentation says number or text...

  • 06-29-2010 09:06 AM In reply to

    I think the issue is that this is a loading rule. Since rules run before code in InfoPath, we can't use qRules in rules that run when the form is opened. For testing, try setting the same rule on a button, just to ensure your command is correct and everything works as anticipated. I'd expect that finishedLoading would be true, not false, since by the time the form is open, it has finished loading, so you may have some other issue with qRules ... for example, if you'd accidentally added code to your form after injecting qRules, you may need to remove code and re-inject. Once you know that qRules is injected correctly and working correctly, you should be able to set your rule on the "finishedLoading" node, since it should change from false to true when the form finishes loading, thus giving you the effect of a form open rule.

    Hilary Stoupa

  • 06-29-2010 10:21 AM In reply to

    Oops.  I already had code in the form before injecting qRules.

    Removed the code, re-injected qRules, and...     Success !!

    Looks like I can add the code back in, if necessary, correct ?

    Also, still wondering what "type" to specify on the SortTable command for a date field...

    Thanks for your help !!

  • 06-29-2010 11:33 AM In reply to

    I would try "text". Since IP stores dates in ISO format, I think that dates might sort correctly as text....

    You can add the code back in -- as of v2.2 you can use qRules with custom code (we can thank Jimmy for that!). You'll find more information on page 46 of the user guide.

    Hilary Stoupa

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