Creating Incrementing Serial Number Button - InfoPath Dev
in

InfoPath Dev

Creating Incrementing Serial Number Button

Last post 03-02-2012 02:37 PM by Hilary Stoupa. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 02-27-2012 12:04 PM

    Creating Incrementing Serial Number Button

    Wondering if qRules can handle this or something Info path can just do. 

    When I pull my line Items from from my SPList I get a couple of blank fields that the User has to populate as expected.  One being a serial Number, Now i don't want it just to auto fill I needed the User to be able to manually populate the serial for each line so I added a button in my repeating table. The user will only populate Serial for orders that will processed for a partial then they can add the rest when the order will be completely filled. So i need the button to take the next number from the List not the form.

    Right now our current Serial number is  SN1203000

     

     

     

     


    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 02-27-2012 12:12 PM In reply to

    Re: Creating Incrementing Serial Number Button

     I don't think there's anything that qRules can do to help you. Unfortunately, it's a tricky scenario. For example:

    (a)  If I click the # button for the first line item, its serial number will be SN1203001, right? And if I click the second line item, the serial number will be the same, because the form is checking the Sharepoint list and not the item right above it in the form, correct?

    (b) You'll have to parse the serial number because InfoPath cannot handle  SN1203000 + 1. So you'll need something like concat("SN", 1203000 + 1).

    (c) What if two users open the form, and then both click the # button. When they submit, you'll end up with two line items with identical serial numbers.

    Anyway, again, I'm sorry but I don't think qRules can help in this case. I'm sorry that the above probably doesn't help; just some things to think about.

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


  • 02-27-2012 12:48 PM In reply to

    Re: Creating Incrementing Serial Number Button

    Very good points. 

    As I have it set up right now Serial field is in my main repeating table that is linked to My list via qRules.  Cant i make it so When they hit # it looks at the list, concats number, and updates my list right away so when the next # is hit it gets the right one?

     

    I am never worried about (c) only one person will ever be assigning serials  

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 02-27-2012 01:14 PM In reply to

    Re: Creating Incrementing Serial Number Button

    To explain it better, when I create my form, my repeating table it is populated from a SPlist which in turn can be edited and updated using  qRules command Updatesharepointlist upon save. 

    What if I had qRules Look at my list check for the last number, creates it +1 then updatesharepoint list.

    So when the next button is pressed it dose the exact same thing but the list will already be updated so it will grab the next number?

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 02-28-2012 05:12 PM In reply to

    Re: Creating Incrementing Serial Number Button

    Sure - I mean in theory that sounds fine. If the form is in heavy use, with lots of users, you still run the risk of overlap. So, on the click of your button, you'd need to query to get the highest serial number - as Ernesto points out, these aren't really numbers, so how will you do that? That would be the first issue. Then, you can, as E. mentions, use some substring functions to get the number portion of that string and increment it, then concat things back together (add the "SN" back on).

    What kind of traffic do you anticipate for this form?

    Hilary Stoupa

  • 02-28-2012 05:28 PM In reply to

    Re: Creating Incrementing Serial Number Button

    Yup I understand but, there will always be only one person assigning serial numbers. Right now they way we handle it is passing around an excel spread sheet from folder to folder.  I'd be surprise if more than one person is the at one moment in time.  I will never be worried about this unless we hire other quality person til then I am not concerned.
    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 02-29-2012 10:02 AM In reply to

    Re: Creating Incrementing Serial Number Button

    My frist question can i create a rule that looks at the SPlist or do i need to create a data connection then have it requery everytime the button is pressed?

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 03-01-2012 07:44 AM In reply to

    Re: Creating Incrementing Serial Number Button

    Safest is to requery the list right before - you have to get the latest data to make sure you have the latest numbers.

    Hilary Stoupa

  • 03-02-2012 10:13 AM In reply to

    Re: Creating Incrementing Serial Number Button

     

    Ok I believe i have the logic down its the execution I need help with.

    I assume I start with a rule that requires the data.  I am assuming the SPlist data source that holds the Serial number field Right?

    Then create a Rule that takes that That "SN00001" breaks it up and adds one and re-adds SN

     

     

    Gabriel Lebron
    Network Admin

    [email protected]

    Integra Companies, Inc.
    29 Saratoga Blvd
    Devens MA 01434
    www.integracompanies.com

  • 03-02-2012 02:37 PM In reply to

    Re: Creating Incrementing Serial Number Button

    So, your initial serial number you listed wasn't 0 padded - you will have some additional work to handle for that - you can use substring-after to get the number portion after "SN", and concat to add it back on - if you search the forum, there may be some formulas you can try for that 0 padding.

    Hilary Stoupa

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