Find Out if No. Series are in use ...

elToritoelTorito Member Posts: 191
Exists any way for look if the No. Series in the G/L are in use?
We have a lot of No. Series where i thinks that are not in used. But I'm not sure. I have try Delete No. Series for look if they make an error that could not delete it because are in use, but, alle the No. Series can be delete without ask if are in used or not.

Okay. Its Only a Reference Table. Buit perhaps anybody knows a little Tipp for find it out if are a No Serie in use or not.

Thanks.
(Oo)=*=(oO)

Comments

  • Tommy_SchouTommy_Schou Member Posts: 117
    Well.. You could look at the No. series and at the fields "Last date used" and "Last No. used". If these are both blank... well.. maybe it hasn't been used! :wink:
    Best regards
    Tommy
  • pdjpdj Member Posts: 643
    Or you could make a small job that goes through all fields related to the no. series table. (Using the system table called "Field")
    Then using RecordRef and FieldRef you could check if they are all used.

    I guess you should ignore tables that end with Entry - otherwise it would take ages 8)
    Regards
    Peter
  • pdjpdj Member Posts: 643
    Couldn't help it. (Needed a short break :oops: )
    Variables:
    Name     DataType   Subtype
    Field    Record     Field
    NoSeries Record     No. Series
    RecRef   RecordRef
    FldRef   FieldRef
    
    OnRun()
    Field.SETRANGE(Field.RelationTableNo,DATABASE::"No. Series");
    IF Field.FIND('-') THEN
      REPEAT
        RecRef.OPEN(Field.TableNo);
        IF STRPOS(RecRef.NAME,'Entry') = 0 THEN
          IF RecRef.FIND('-') THEN
            REPEAT
              FldRef := RecRef.FIELD(Field."No.");
              IF NoSeries.GET(FldRef.VALUE) THEN
                NoSeries.MARK(TRUE);
            UNTIL RecRef.NEXT = 0;
      UNTIL Field.NEXT = 0;
    MESSAGE('Any record NOT marked is NOT referenced from any field with a table relation to it.');
    FORM.RUN(0,NoSeries);
    
    Regards
    Peter
  • Tommy_SchouTommy_Schou Member Posts: 117
    Get back to work dude! :p
    Best regards
    Tommy
  • elToritoelTorito Member Posts: 191
    Well.. You could look at the No. series and at the fields "Last date used" and "Last No. used". If these are both blank... well.. maybe it hasn't been used! :wink:

    Hmm Well. But if i Make New Item oder New Vendor ... and Set Manually No. then the Date and LastNr Getted, will don't change.
    (Oo)=*=(oO)
  • elToritoelTorito Member Posts: 191
    pdj wrote:
    Or you could make a small job that goes through all fields related to the no. series table. (Using the system table called "Field")
    Then using RecordRef and FieldRef you could check if they are all used.

    I guess you should ignore tables that end with Entry - otherwise it would take ages 8)

    Hmmpf. ... I can't find System Table "Field" :?: :roll:
    What Id's have the System Tables ?

    Thanks


    Peter
    (Oo)=*=(oO)
  • lawlaw Member Posts: 19
    You cannot see it in Object Designer. Make a list form on table 2000000041 (Field).
  • elToritoelTorito Member Posts: 191
    law wrote:
    You cannot see it in Object Designer. Make a list form on table 2000000041 (Field).

    Thanks. Now I'm Trying with the Code from Peter.
    I create a new No. Serie but it doesn't seem to Mark it.
    But it's a good base, perhaps i must experiment a little bit.

    Thanks you.
    Peter
    (Oo)=*=(oO)
  • pdjpdj Member Posts: 643
    elTorito wrote:
    I create a new No. Serie but it doesn't seem to Mark it.
    That was the entire point, wasn't it?
    The code marks the No. Series that are used. So if you create a new one and don't have used it anywhere it will not be marked.
    Regards
    Peter
Sign In or Register to comment.