No. Series Renewing

BeliasBelias Member Posts: 2,998
edited 2010-01-06 in NAV Tips & Tricks
hi everyone: sometimes new year means new no. series to create. to make this thing faster for me or for customer that does this alone, i've created this form (it's rude, i know, but i've done it in 2 hour this morning, after a week of holidays).
OBJECT Form 55667 NoSeriesRenew
{
  OBJECT-PROPERTIES
  {
    Date=04/01/10;
    Time=16.30.48;
    Modified=Yes;
    Version List=Utility;
  }
  PROPERTIES
  {
    Width=17710;
    Height=16060;
    MaximizedOnOpen=Yes;
    SourceTable=Table309;
    SourceTableTemporary=Yes;
    OnOpenForm=BEGIN
                 TBNoserLine.SETCURRENTKEY("Series Code","Starting Date","Starting No.");
                 TBNoserLine.FINDSET;
                 REPEAT
                   TBNoserLineCheck.SETRANGE("Series Code",TBNoserLine."Series Code");
                   TBNoserLineCheck.FINDLAST;
                   Rec := TBNoserLineCheck;
                   IF Rec.INSERT THEN;
                 UNTIL TBNoserLine.NEXT = 0;

                 TBNoserLineTemp.DELETEALL;
                 Rec.FINDSET;
                 REPEAT
                   TBNoserLineTemp := Rec;
                   TBNoserLineTemp.INSERT;
                 UNTIL Rec.NEXT = 0;
               END;

    OnCloseForm=BEGIN
                  Rec.RESET;
                  TBNoserLineTemp.RESET;
                  IF Rec.FINDSET THEN BEGIN
                    REPEAT
                      IF NOT TBNoserLineTemp.GET("Series Code","Line No.") THEN BEGIN
                        TBNoserLine := Rec;
                        TBNoserLine.INSERT;
                      END;
                    UNTIL Rec.NEXT = 0;
                  END;
                END;

  }
  CONTROLS
  {
    { 1130000;TableBox  ;110  ;110  ;17600;15950;HorzGlue=Both;
                                                 VertGlue=Both }
    { 1130001;TextBox   ;159  ;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Series Code";
                                                 OnValidate=BEGIN
                                                              Rec.SETRANGE("Series Code","Series Code");
                                                              Rec.FINDLAST;
                                                              Rec.SETRANGE("Series Code");
                                                              Rec."Starting Date" := CALCDATE('<1Y>',Rec."Starting Date");
                                                              Rec."Line No." := Rec."Line No." + 10000;
                                                              Rec."Warning No." := '';
                                                              Rec."Ending No." := '';
                                                              Rec."Last Date Used" := 0D;
                                                              Rec."Last No. Used" := '';
                                                            END;
                                                             }
    { 1130002;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130001;
                                                 InColumnHeading=Yes }
    { 1130003;TextBox   ;1859 ;3520 ;1700 ;440  ;Editable=No;
                                                 ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Line No." }
    { 1130004;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130003;
                                                 InColumnHeading=Yes }
    { 1130005;TextBox   ;3559 ;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Starting Date" }
    { 1130006;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130005;
                                                 InColumnHeading=Yes }
    { 1130007;TextBox   ;5259 ;3520 ;1693 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Starting No." }
    { 1130008;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130007;
                                                 InColumnHeading=Yes }
    { 1130009;TextBox   ;6959 ;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Ending No." }
    { 1130010;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130009;
                                                 InColumnHeading=Yes }
    { 1130011;TextBox   ;8659 ;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Warning No." }
    { 1130012;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130011;
                                                 InColumnHeading=Yes }
    { 1130013;TextBox   ;10359;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Increment-by No." }
    { 1130014;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130013;
                                                 InColumnHeading=Yes }
    { 1130015;TextBox   ;12059;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Last No. Used" }
    { 1130016;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130015;
                                                 InColumnHeading=Yes }
    { 1130017;CheckBox  ;13759;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 ShowCaption=No;
                                                 SourceExpr=Open }
    { 1130018;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130017;
                                                 InColumnHeading=Yes }
    { 1130019;TextBox   ;15459;3520 ;1700 ;440  ;ParentControl=1130000;
                                                 InColumn=Yes;
                                                 SourceExpr="Last Date Used" }
    { 1130020;Label     ;0    ;0    ;0    ;0    ;ParentControl=1130019;
                                                 InColumnHeading=Yes }
  }
  CODE
  {
    VAR
      TBNoserLine@1130001 : Record 309;
      TBNoserLineCheck@1130002 : Record 309;
      TBNoserLineTemp@1130003 : TEMPORARY Record 309;

    BEGIN
    END.
  }
}

The form will show the last no. series line for each series code, and it allows you to insert new lines: just insert a new line in the form with f3 and copy the value of the series code with F8: the line no. is automatically incremented by 10000 and the starting date is automatically incremented by 1 year. You just have to adjust the starting no. on the line.
ending no., warning no., last no. used, last date used fields are cleared. The data is commited when you close the form, because the user is working on a temporary table
Please give me feedback about this, enjoy!
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog

Comments

  • youcantouchthisyoucantouchthis Member Posts: 5
    When someone has nothing to do... it's a great thing to do some utilz! =D> =D>
    Happy new year!

    When you want to make some more difficult things just tell me... :roll:
  • BeliasBelias Member Posts: 2,998
    When you want to make some more difficult things just tell me... :roll:
    :-k i can't get this...what do you mean?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • youcantouchthisyoucantouchthis Member Posts: 5
    Belias wrote:
    When you want to make some more difficult things just tell me... :roll:
    :-k i can't get this...what do you mean?

    You can get this? well..
    I want to show a DB Explosion with multiple levels.
    When you click on an item, it should explode the level below. So you can have all the DB tree in one shot.

    Is it possible?
  • BeliasBelias Member Posts: 2,998
    i don't know, but it's better for you to open a new topic in the right section of the forum and explain your problem better...here it is off topic and maybe noone will answer.
    I hope to read your topic soon :wink:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • youcantouchthisyoucantouchthis Member Posts: 5
    You told me you can get this..... and now you ask me to move the topic?
    ](*,)
    Maybe it's better for you to back on your... No. Series Renewing tests!

    bye bye!
  • BeliasBelias Member Posts: 2,998
    You told me you can get this...
    I've never told something like this, can you please quote where i wrote that i can achieve something i've never done and i've not understood from the only little info you've written?i told you to open a new topic in order to have other people's suggestions and to explain better what you want to do: because it's not clear in my opinion.
    P.S.: you should be more kind with people that try to help you; don't provoke me further, i won't answer
    P.P.S.: did you read the title of the section? "Tips&Tricks": this means that it is the place to post already solved problems that can be helpful for others. If you don't like my code, don't use it (did you even try to import the form?)
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • BeliasBelias Member Posts: 2,998
    aha, i think you have misread this phrase
    i can't get this...what do you mean?
    note the " 't " after the "can" :mrgreen:
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • youcantouchthisyoucantouchthis Member Posts: 5
    Belias wrote:
    aha, i think you have misread this phrase
    i can't get this...what do you mean?
    note the " 't " after the "can" :mrgreen:

    Ahah I misunderstood the "t"! I thought u were in god mode!
    Hi belias. strange nick
Sign In or Register to comment.