Creating Custom Document Number - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Creating Custom Document Number

Last post 01-05-2014 07:07 PM by amieqq. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-06-2013 10:56 AM

    Creating Custom Document Number

    I need my browser list form to autogenerate a document name that has the following format:

    REG-YYMMNN

    REG- being the particular region 

    YY for the last 2 digits of the year

    MM for the month it is generated

    NN for a sequential number within the month. For example, the first document in March would be 130301, the second would be 130302 and so forth. This number needs to start from 01 every month (reset to 01).

    I know how to do REG-, YY and MM applying the substring function on the region and date fields, however I can't think of a way to make the NN work.

    Any (codeless) hints will be greatly appreciated.

     

  • 03-09-2013 01:05 PM In reply to

    Re: Creating Custom Document Number

    Hi FerroMinera and welcome,

    You can definitely do this without code. However, you will need to promote a column to your SharePoint library for the year and month (1303) and then use that in a query filter to get the last submitted ID. Just query and filter for all those with 1303 and us a function of count(field)+1 command where field is the secondary data source repeating group to calculate the next ID.

    To prevent problems if two people submit at the same time you will need to first submit the form without the ID and then query and get the count(field) which will include your submitted form (so no need to do +1) and then use that to calculate and submit again. This ensures that you won't run into contention if two people try to submit at the same time.

    Send us email if you need help. Should be a 15-30 minute show-and-tell.

    Patrick Halstead
    Project Manager at Qdabra
  • 01-05-2014 07:07 PM In reply to

    • amieqq
    • Not Ranked
    • Joined on 06-07-2013
    • Posts 8

    Re: Creating Custom Document Number

    Hi, Patrick, I'm using your way to get InfoPath sequential numbering work. I try to name the file using the sequetial IDs. Here's my question: the first time I submit the form, I still need to count IDs to get a file name for it. When two users submit at same time, one will submit successfully while the other will get a message"Some rules are not applied". The one fails will need to click submit again. Is there any way to get this message more user friendly or a way that two users can submit successfully at same time?

    Thanks in advance!

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