Options

No Series Grouping

ArhontisArhontis Member Posts: 667
Hello everyone,

I wish you all to have a great autumn...

I had some thought and I could use your recommendations.

I want to be able to group the No. Series with a new field in that table, and when one of the series is incremented the other series in that group whould increment also.

Thanks,
Arhontis

Comments

  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Hi,

    Looks like an ajustment in codeunit 396, NoSeriesMgt.

    Try funcion GetNextNo.

    read the connecting NoSeries and just update them in the same function.

    Look out for the ModifySeries Boolean, if this is false, the noseries is not modified.

    Hope this helps, let me know how you solved it.
  • Options
    ArhontisArhontis Member Posts: 667
    Hi Mark,

    I thought about it and I decided not to touch the NoSeriesManagement codeunit, so I made a function in a codeunit of my own and placed the code:
    UpdateSeriesGroup("No. Series Code" : Code[10];"Posting Date" : Date;"Modify Series" : Boolean)
    BEGIN
      CurrentNoSeries.GET("No. Series Code");
      IF CurrentNoSeries."Series Group"='' THEN 
        EXIT;
      GroupedSeries.RESET;
      GroupedSeries.SETFILTER("Series Group", CurrentNoSeries."Series Group");
      GroupedSeries.SETFILTER(Code, '<>'+"No. Series Code");
      IF GroupedSeries.FIND('-')THEN REPEAT
        NoSeriesMgt.GetNextNo(GroupedSeries.Code,"Posting Date",TRUE);
      UNTIL GroupedSeries.NEXT = 0;
    END;
    
    and in the Sales-post and Purch.-Post codeunits added the call to my function after every GetNextNo call (4 occurrencies each).

    What do you think?
  • Options
    Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Looks fine to me.

    Only problem: If you forget to call your function from the posting cu. the grouped no.series are not update.

    E.g. what if the user decides to use grouped no.series with the item table? Your function is not called then.

    Don't be affraid to change the Navision codeunit. there is no problem with it as look as you test and document well.
  • Options
    ArhontisArhontis Member Posts: 667
    Yep, you are right, the functionality I needed only includes the posting series of sales and purchases, so that is not a problem...

    In addition, I was thinking to place a loop check of all the series in a group at the end of that function to check if the numbers of the group match each other.

    Anyway, thank you very much for your time Mark.
Sign In or Register to comment.