Repeating table - autofill dates in rows - InfoPath Dev
in

InfoPath Dev

Repeating table - autofill dates in rows

Last post 12-14-2011 12:15 PM by Jimmy. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 12-06-2011 11:26 AM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Repeating table - autofill dates in rows

    Using IP 2007.  I am building a travel request form.  I have two travel dates; DepartureDate and ReturnDate, say they equal 3 days total.  Next I have a repeating table to record each days daily expenses for applicable expenses (per diems, hotel, air or ground transportaion etc).

     Is it possible to have the the correct travel dates automatically create 3 rows in my repeating table and autofill a datepicker control?  I don't want to have to put in all kinds of validation rules to make sure the dates entered for expense line up with the actual travel dates.  Is there a best practice on this situation?


    I am open to suggestions.


    Thank you.

  • 12-12-2011 08:41 AM In reply to

    Re: Repeating table - autofill dates in rows

    Anything that involves adding rows to a repeating table can't be done with InfoPath's built-in features, but you can accomplish this fairly easily if you have qRules, using the DateDiff and Insert commands.  If you can download the trial version of qRules, inject it into a blank form, and attach it to this thread, I can show you how to create this functionality.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-12-2011 11:01 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Repeating table - autofill dates in rows

    That was fun. Blank and injected form, attached!  Thanks.

    BTW, the qRules v3.3 quick start guide needs to be updated in "Download and Install qRules" section to remove references to "install.js" and replace with "Install Forms".

    Filed under:
  • 12-13-2011 02:07 PM In reply to

    Re: Repeating table - autofill dates in rows

    Thanks!  And thank you for the note about the quick start guide.

    This form should give you the general idea.  All of the salient logic is in the button's rules.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-14-2011 09:43 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Repeating table - autofill dates in rows

    Jimmy

    Thank you for taking the time to create an example for me!  It is exactly what I was trying to do.  My form calculates DateDiff in a more complex way - your way is much cleaner. 

    I am wondering (stupid question coming), in the button rules, what do the fields Command and Result do?  I don't see them in the secondary data connection and I looked at the QdabraRules xml and xsd -- I see they are elements...but I don't understand how they work?  Are they references to code in the dll that accompanied the form template and/or do they refer to code in the qRules I installed?    I am guessing their functionality is hidden to me?

    Will this form stop working when my qRules trial expires? 

     Doreen

  • 12-14-2011 11:06 AM In reply to

    Re: Repeating table - autofill dates in rows

    Hello Doreen,

     The way qRules works is that you assign a command to the Command field, and then the qRules code inside the form processes that command, performs whatever action it indicates, and if the command is one that has some sort of scalar output value, sets that value to the Result field so you can retrieve it there.  The user's guide has more details about all the commands that are available.

    Yes, the qRules functionality will stop working when the trial expires.  If this seems like a good solution to your task, I hope that you will consider purchasing the full version, which never expires and can be used in an unlimited number of forms.  It is true that there are ways to do DateDiff without code, but if you want to add or remove rows in repeating tables, qRules or your own custom code are the only options, and qRules is a great value compared to the time and effort involved in writing your own code.

    Jimmy

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-14-2011 11:39 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Repeating table - autofill dates in rows

    okay I understand.  super cool.  In order for me to be sold on this idea, I need to know scalability of qRules...

    One more question, I am using IP 2007 and SharePoint 2007 - we are planning to upgrade to SharePoint 2010 - will any IP 2007 forms I create with qRules continue to work with SharePoint 2010?

    Filed under:
  • 12-14-2011 12:15 PM In reply to

    Re: Repeating table - autofill dates in rows

    Yes, absolutely. That should work fine.

    To the best of my knowledge, qRules should not have any scalability concerns.  It is self-contained and relatively lightweight, so it shouldn't present any issues, even running on IPFS.  If you have any specific questions about scalability, we'd be happy to answer them.

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