No. Series Starting No. Problem.....

alok_didaalok_dida Member Posts: 73
I have one number series in which start no. is 20100101-001 to 20011231-999 (its formate like YYYYMMDD-DocNo)



Now for assigning no i have to do like TODAYDATE-DocNo .... so i have to assign this number based on today date and latest document no. + 1... how can i achieve this?

Comments

  • Lec11Lec11 Member Posts: 91
    Create the no. series only for the DocNo and build the whole number at the moment you create the document based on TODAY and the next DocNo from the no. series.
  • alok_didaalok_dida Member Posts: 73
    Lec11 wrote:
    Create the no. series only for the DocNo and build the whole number at the moment you create the document based on TODAY and the next DocNo from the no. series.
    can u explain me in more detail... i cant change the no. series .. client already provide me format for it,.... i can't do above step that u mention.. i have to handle whole above part through coding!!
  • Lec11Lec11 Member Posts: 91
    Like I said before ... first create the number series as starting from 001 and ending at 999.

    Put the following line in the OnInsert trigger of your table:
    YourField := DELCHR(FORMAT(TODAY,0,9),'=','-') + '-' + NoSeriesMgt.GetNextNo(YourNoSeries,0D,TRUE);
  • BeliasBelias Member Posts: 2,998
    a little explanation: INCSTR function is used during the autoincrement of number series: if you take a look at the online help for INCSTR, you'll notice that your request is impossible without customization (you're trying to increment a number that is not the last one). One possible solution is the one posted by Lec11, another one is this (never tried before :mrgreen: ):
    http://www.mibuso.com/forum/viewtopic.php?f=23&t=42434
    note: 999 documents per year are not much (less than 3 per day) ; if this will be your official serial number, i suggest you to increment it at least to 4 digits (9999 documents per year)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
Sign In or Register to comment.