Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Clarification required in No Series issue in NAV 2015

(0) ShareShare
ReportReport
Posted on by

In sales journal I have created 5 batches and for each batch I have given the same No. Series. So 5 different users are working on these batches and when they try to post it says Document No. must be ####.... and that document is in some other batch. So that user will have to wait till other users post that document. 

Is there a setup that I can configure to ignore this validation in NAV?

PS. Keeping Posting No. Series is not a option because my client want to print the sales invoice in the journal itself and If I use the posting No. series then the printed sales invoice no and posted invoice no will be different and he is not agree with that. 

*This post is locked for comments

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Clarification required in No Series issue in NAV 2015

    Addition to above you need to control how the delete will happen. If you allow user to delete new documents then it will create a gap in the posted documents.

    However if the user delete the document you do not have any control on changing the No. Series back to previous No.

    To warn the user about this put this code in the OnDelete trigger of the 81 table.

    IF "New Line" = TRUE THEN BEGIN

     IF CONFIRM('You have already assign a Document No. and If you proceed there will be a gap in the No. Series, Do you want to Proceed?', TRUE,TRUE) THEN BEGIN

     END ELSE BEGIN

        ERROR('Process Halt');

     END;

    END;

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Clarification required in No Series issue in NAV 2015

    Did you found a solution for this?

    If no please try this.

    In the Gen. Journal Line (81) there is a function call NewLine. That is the function which control assigning numbers to the documents.

    In that modify the code like below

    IF GenJnlLine.FINDFIRST THEN BEGIN

     "Posting Date" := LastGenJnlLine."Posting Date";

     "Document Date" := LastGenJnlLine."Posting Date";

     "Document No." := LastGenJnlLine."Document No.";

     IF BottomLine AND

        (Balance - LastGenJnlLine."Balance (LCY)" = 0) AND

        NOT LastGenJnlLine.EmptyLine

     THEN BEGIN

       //"Document No." := NoSeriesMgt.GetNextNo(GenJnlBatch."No. Series","Posting Date",TRUE); // INCSTR("Document No.");

     END;

    END ELSE BEGIN

    After that insert another new field type Bool to 81 table and then write below code in the Onvalidate Trigger

    IF "New Line" = TRUE THEN BEGIN

     GenJnlBatch01.RESET;

     GenJnlBatch01.SETFILTER(GenJnlBatch01."Journal Template Name","Journal Template Name");

     GenJnlBatch01.SETFILTER(GenJnlBatch01.Name,"Journal Batch Name");

     IF GenJnlBatch01.FINDFIRST THEN BEGIN

     "Document No." := NoSeriesMgt.GetNextNo(GenJnlBatch01."No. Series","Posting Date",TRUE); // INCSTR("Document No.");

     END;

    END ELSE BEGIN

     IF CONFIRM('You have already assign a Document No. and If you proceed there will be a gap in the No. Series, Do you want to Proceed?', TRUE,TRUE) THEN BEGIN

     END ELSE BEGIN

        ERROR('Process Halt');

     END;

    END;

    By doing this document No will only created at the time of user tick the new field.

  • Community Member Profile Picture
    on at
    RE: Clarification required in No Series issue in NAV 2015

    Thank you for the answers. Specially for Saurabh for the workaround. I will check this tomorrow and will reply back.

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: Clarification required in No Series issue in NAV 2015

    There is no setup that you can set to achieve this.

    Plus I don't think you should do this because even if you customize to have Journal no. Series to post to ledgers, what if a user delete a line? Then your ledger will not have a proper number order and account department might face problem during account audit.

  • Verified answer
    Saurabh Shah Profile Picture
    4,560 on at
    RE: Clarification required in No Series issue in NAV 2015

    Hi,

    Since you are using the same number series for multiple batch, if means that if create one entry in batch one and if its document number is A001 and the same time some other user create the journal his document number will also A001. now if user one post the line then the customer ledger entry will create with Document No. A001 so next time from other batch how can system allow the same number for posting. it is compulsory require a different document number.

    For first posting there will not be any error but ofcouse for second one there is because the same document number is already posted and because of this reason there is a facility available to define different number series definition against the batch and also the different posting number series.

    In your case, if you want to keep the same number series then in that case, it need to do some development to update the last number on creation of line (same as what system is doing on posting) but this is require to take extra care because if some one delete the line then there will be a missing number.

    I have one suggestion if you can,

    1) Create one posting number series and assign it to different batch. or you can set it in General ledger setup by adding one field for number series.

    2) Add one field on sales journal called "Posting Number" or you can update the document number field itself.

    3) Create action called "Assign Posting number" in Sales journal - Action bar

    4) After successfully creation of journal. User will click on above action button and system will assign the posting number based on the posting number series and also update last number used against the number series.

    5) now in your sales invoice print. you print this number as document number.

    6) on posting. you need to post the document with this number.

    Above suggestion needs customization in the system.

    -Saurabh Shah

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans