Display a data update - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Display a data update

Last post 09-13-2013 03:36 PM by Doreen. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-13-2013 12:35 PM

    Display a data update

    I have a form that I use for requistions. I set the Req# to be the Max data ID +1 to generate a new Req#( they do not need to match, nor be exactly 1 off, it is just I need a unique # for the req#.) The Req#field gets filled out, and the user finishes the form and clicks save to submit the form. All is good.

     That is, until two users access the Req form at the same time. Then they both get assigned the same Req# as the time from opening a new req form and saving the request can take over 20 minutes. I have considered several plans of attack, but all are shot down for various reasons. So, what I would like to do is once the Save button is clicked, I would like to check the Max(ID) one more time as the record is being written, and reassign the Req# to be Max(ID) + 1. That way no two req#s will be the same.

     I would then like the system to indicate the changed #, either by a message box that tells the user of the change, or at least changes the Req# format to Red, or Bold Text...something that would show a change.

    I code in VB. (In old VB, you just set the event for the Req# textbox that one change of the value, it changes the object's format. I can't find object properties, so I cannot seem to be able to do that.)

    Professionalism, Understanding, and Attention is how I deliver quality to my clients.
  • 09-13-2013 02:23 PM In reply to

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

    It sounds like you are a candidate for using this auto-numbering technique:

    http://www.infopathdev.com/forums/p/26341/91512.aspx#91512

    And I just today, wrote a way to reset the number after-the-fact when a sequentially numbered field gets mis-numbered due to issue you encountered (i.e. two users...).  BUT you won't need it if you re-design your numbering rules per link.

     Update: I assume you are submitting your form to SharePoint list.  If you are not then this method will not work for you because the numbering is based off the next library ID upon submission which is always unique - in that library only.

     Doreen

  • 09-13-2013 02:46 PM In reply to

    Thanks. Yes, it is to sharepoint.
    Professionalism, Understanding, and Attention is how I deliver quality to my clients.
  • 09-13-2013 03:17 PM In reply to

    Turns out, what I want to do doesn't seem doable...at least at my primitive level of skill with Infopath. I am coming from the VB world, where I am used to making a form do whatever I want. I have to get used to the limitations of web-based forms.

    One thign I considered, to lesen the frequency of the dupe IDs wa to make the ID the YYYYMMDDHHMMSS of creation, that way, dupes would only be created on the off chance that two people started a req at the very same second...which is unlikely given the number of reqs we process. But, the customer complained it was too many numbers to write down to track orders. And, as I said, dupes aren't a critical fail, just an annoying issue.

     

    But, even so, thanks for the timely response. I hope to develop my skills to the point I can reciprocate or pass on help to others.

    Professionalism, Understanding, and Attention is how I deliver quality to my clients.
  • 09-13-2013 03:36 PM In reply to

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

    Interesting because in the method I suggested, the "key" field is set to value InfoPath "now()" function, which is roughly equivalent to what you were hoping to acheive by going to the seconds (datetime).  This key value is key (pun intended) to going back to retrieve the correct ID during the double-submit phase which will always set your req# as an original.

     It is all done without code behind too but you could do the whole thing with code if you like.  I am a C# girl myself.

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