Sequential Numbering based on list values - InfoPath Dev
in

InfoPath Dev

Sequential Numbering based on list values

Last post 11-21-2011 06:22 AM by cory_booth. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 11-15-2011 11:45 AM

    Sequential Numbering based on list values

    I have a requirement to number items placed on order.

    These numbers roll into an actual tracking code.

    The items on order come from an InfoPath repeating table. 

    ----------------------------------------------------------------------------------------

     Here is the difficult part.

    The numbers are sequentially added through the business day.

    So if I have an infopath form with two items submitted, I would have 1 and 2

    If another form is submited with three items (on the same day), I would have 3, 4, and 5

    and so on...

    The numbers are then appended to a Jullian Date (which I have already calculated).

     ------------

    The next day, the numbering starts over...

     

     

    I have a button which saves the repeating table contents to a sharepoint list via C#

    The problem is, I am not sure how to tackle numbering the items for order.

     

    I would have to check the list for any prior orders for the current day and begin numbering from that point forward...

     

    Anyone have any ideas?

     

  • 11-18-2011 08:39 AM In reply to

    Re: Sequential Numbering based on list values

    You can use rules to do this.

    I would recommend 2 rules:
    1st: Query your list to make sure your have every new change to it (this can take a while if the list is long, but can be taken out but making sure you can't click the button twice)
    2nd: Set some fields value to Formula( max(  <list from above>[number appended to julian date field contains today's julian date]) +1 )

    This sounds complicated since I didn't use field names, buts its really not, all it does it looks at your list and counts how many items have today's date in them and adds one to it.
    So if there are no items in the list, this item is the first, if there are three, this item is the fourth.

    You may have some problems getting the julian date in IP.

    May I ask why are you using the julian date?

     

    You could also use a second field that was just a date and have the formula check to see if that date matches today's date.

  • 11-21-2011 06:22 AM In reply to

    Re: Sequential Numbering based on list values

    Thanks for the reply...

    Yes, that's about what I wound up doing.  I saved the year, julian date and the sequential numbers to custom columns.  I then did a data source receive connection to these columns.

    In my form, I read into a temp field, a filtered on julian date/year return of the sequential number - if null = 0

    I then add +1 to the returned value and begin my routine.

     


    For the record, to compute the julian date (which is different than the julian day)....
    I used the julian day formula posted here: http://www.infopathdev.com/forums/t/16958.aspx

    This returns an julian day number (like 26343) or so...

    I needed the julian date which is the numerical number of the day of the year.

    So...  using the formula above, I get the julain day for today.
    I then compute the value for a manually created date "01/01/2011"

    Subtracting the difference between the two gives me the actual day of the year.

     ----------------------------

    In the military, the julian date is a fundemental portion of an ordering number string in various automated logisitical systems.

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