Invoice number already exists.

JTPro
Member Posts: 169
Hello All,
I'm facing such a problem: When I want to insert new invoice, system is showing the error, that this number already exists. Of course it is not true.
I searched entire forum, and found nothing. I tried to increase the last used number in series no., but didn't help.
What can be wrong?
I need your help.
Best regards.
JTPro
I'm facing such a problem: When I want to insert new invoice, system is showing the error, that this number already exists. Of course it is not true.
I searched entire forum, and found nothing. I tried to increase the last used number in series no., but didn't help.
What can be wrong?
I need your help.
Best regards.
JTPro
Navision Application Version: 4.0SP1
Navision Database Version: 4.0
Navision Database Version: 4.0
0
Comments
-
JTPro,
- Aren't you using the same Post Series No. for different document types?
- Are you using some kind multiple-times payment?
I had this problem when we developed the mulitple-times payment. Once again, I had this problem when somebody changed the Post Series No. on the invoice to the same number as the Invoice No.
Check these out, this might help you!Marcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0 -
turn on the debugger and put the code in here where it stops. My guess you have some kind of modification.0
-
Hello,
Thank you for your posts.
ara3n:
Debugger says nothing. I already tried it. Even if you put data directly to the table, the error message shows up. It drives me crazy ](*,) .
I will check what markborges suggested. I hope it will be it.
Best regards
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Hello,
Markborges, I just realized that I developed such functionality, that takes the number from the Series No. of Invoice and put it into the Posting No. field on Invoice. This is some kind of buffor. If an accounter is sure, that the invoice is ok, then it post it and the number of posted invoice is the one from Posting No. field. This is really strange, because it had been working for a long time. Maybe I miss something :-k
Any help is apretiate appreciate.
Best regards
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Hi
Any changes made to Codeunit 80?
Is this when you try to post an Order into an Invoice?
If so there is a field in the Sales Header table "Posting No.", this is populated sometimes in the Posting Codeunit, then if there was an error the header is updated but not posted, the next invoice takes the same number, then when you try to invoice the order you get this message, as codeunit 80, does not get the next number if the header is already marked with a Posting Number.
I do remember this being a problem on a Modified database but not on a standard.
There is this code which only gets a new number if "Posting No." is blank.
A few lines later it does a commit, if an error occurs after the header has been updated, although the number series should have been updated before the Commit.
IF Invoice AND ("Posting No." = '') THEN BEGIN
IF ("No. Series" <> '') OR
("Document Type" IN ["Document Type"::Order,"Document Type"::"Return Order"])
THEN
TESTFIELD("Posting No. Series");
IF ("No. Series" <> "Posting No. Series") OR
("Document Type" IN ["Document Type"::Order,"Document Type"::"Return Order"])
THEN BEGIN
"Posting No." := NoSeriesMgt.GetNextNo("Posting No. Series","Posting Date",TRUE);
ModifyHeader := TRUE;
END;
END;
So if there are modifications you need to clear the "Posting No." in codeunit 80 to stop this error.Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
Hi,
I didn't touch codeunit 80.
I made modification on Invoice form, that allows user to choose the series no. for later posting.
It looks like that:IF ("Posting No." = '') THEN BEGIN InvoicePostingNoSelection := STRMENU(Text55000,2); IF InvoicePostingNoSelection <> 0 THEN BEGIN InvoiceMessageText[1] := 'S+FA'; InvoiceMessageText[2] := 'S+FAV'; PostingNoSeries := InvoiceMessageText[InvoicePostingNoSelection]; // MESSAGE('Posting No Series: %1',PostingNoSeries); Rec."Posting No." := NoSeriesMgt.GetNextNo(PostingNoSeries,"Posting Date",TRUE); // MESSAGE('Posting No: %1', Rec."Posting No."); MODIFY; END; END;
It had been working for a long time. ](*,)
Why me? Why me?
Thanks a lot for your answers.
Best regards.
JTPro[/quote]Navision Application Version: 4.0SP1
Navision Database Version: 4.00 -
JTPro,
Check all you Numbering fields under Sales & Receivables Setup (Numbering Tab), specially the "Invoice Nos." and "Posted Invoice Nos.". Check if they're not the same!Marcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0 -
Hi,
Checked, and everything looks fine. There are different Nos. for each type of document.
Still nothing.
Best regards
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Hello guys,
I found something. I decided to look more deeply, so I made a backup of a database (SQL2000 one), and created native database. After I made a restore, I tried to make invoice, and everything works fine?
SQL? Now, this is really strange.
Any idea?
Best regards
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Hello all,
The mystary has been solved. There was something wrong with my sql database (no idea what was it :-k ). I created a new database, and restore the old one. Now, everything seems to be ok.
Thanks a lot for your time.
Best regards.
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Glad to Help, and like Kriki says:
"Let [Solved] be in your title"Marcelo Borges
D365 Business Central Solutions Architect
BC AL/NAV C/AL Developer
BC Repositories.com0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions