Printing slip just afer posting an order

JTPro
Member Posts: 169
Hello all,
I put some code inside the codeunit 81 (Sales Post Yes/No), that suppose to print slip based on "Last posting no.". I don't know why I have following error:
Sales Header doesn't exist
Identification field and values:
Document type = 'Order', No. = 'C06/00045'
Document type =Order, No. = C06/00045
The document is posted properly, but slip is not send to the printer.
I saw posts, that say about this issue, but without any solution.
Thanks in advance for your responses.
Best regards
JTPro
I put some code inside the codeunit 81 (Sales Post Yes/No), that suppose to print slip based on "Last posting no.". I don't know why I have following error:
Sales Header doesn't exist
Identification field and values:
Document type = 'Order', No. = 'C06/00045'
Document type =Order, No. = C06/00045
The document is posted properly, but slip is not send to the printer.
I saw posts, that say about this issue, but without any solution.
Thanks in advance for your responses.
Best regards
JTPro
Navision Application Version: 4.0SP1
Navision Database Version: 4.0
Navision Database Version: 4.0
0
Comments
-
Hi
The sales header is deleted in teh CU80 so the report can not be printed in CU81.
You should write your code in CU80 -> OnRun trigger
write the code before any deletion code is exceuted. Probably before the following Standard Code-
// Modify/delete sales header and sales lines
IF NOT RECORDLEVELLOCKING THEN BEGIN
IF WhseReceive THEN
WhseRcptLine.LOCKTABLE(TRUE,TRUE);
IF WhseShip THEN
WhseShptLine.LOCKTABLE(TRUE,TRUE);
IF DropShipOrder THEN BEGIN
PurchOrderLine.LOCKTABLE(TRUE,TRUE);
PurchOrderHeader.LOCKTABLE(TRUE,TRUE);
END;
I hope this will work
Best Regards
Mukesh0 -
JTPro wrote:Hello all,
I put some code inside the codeunit 81 (Sales Post Yes/No), that suppose to print slip based on "Last posting no.". I don't know why I have following error:
Sales Header doesn't exist
Identification field and values:
Document type = 'Order', No. = 'C06/00045'
Document type =Order, No. = C06/00045
The document is posted properly, but slip is not send to the printer.
I saw posts, that say about this issue, but without any solution.
Thanks in advance for your responses.
Best regards
JTPro
It depends on where you put the code. But based on your problem, it looks like you're putting the code after it has gone through the posting routine.
In this case, you can either:
1. Put the code before the posting routine is ran
2. Modify the report to use the Sales Invoice Header table instead of the Sales Header table.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
1) You are talking about "Last posting no." - this is No. of the invoice. But when I see the error, you are working with the order... are you sure that you are not mixing two things together???
2) And yes, as mukesve and deadlizard wrote, the sales header if all is posted, is deleted after posting (you can find the DELETE; function in the CU80 near the end of the main function...0 -
Thanks for your responses.
I'm using "Last posting No." to get information form Sales Invoice Header, and use it to print a slip. The strange think is that the message shows that there is a problem with table Sales Header? ](*,)
I don't really know what is wrong.
And another strange thing is that my modification works once a while. Mhm
Any idea? Navision bug?
Navision version: 4.00 Sp2
Best regards
JTProNavision Application Version: 4.0SP1
Navision Database Version: 4.00 -
Dear Friend,
This is not a bug.
Explanation:
No. series is attached on the sales header based on which the last number is updated in the no. series line.
The sales header and lines are deleted on posting of the sales invoice (invoice option) and 100% sales invoice and shipment (sales order option) and the transactions are posted in Sales Invoice Header/line and Sale Shipment header/line table. Therefore the system does not find any record in the sales order header/line table.
Sales Invoice header has fields "Order No." , "Pre Assined No." which can be used to get the purchase order/invoice number at the time of creation.
ihope it makes clear.CA Sandeep Singla
http://ssdynamics.co.in0 -
You can use debugger to find the code, where the error arise from. Than you can check, if you are correctly reading the data, if you really want to get order header or just invoice header...0
-
Why not just modify your report to go off of the sales invoice header table and add this report to the Report Selections table? :-kConfessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0 -
I'm aware that this is an old threat but I’m not sure the problem is that simple.
I get the same error with a customer running NAV 3.70 but in my example none of the above could be the reason because:
There is no modification to the posting routines. So it is not because I cal some code after deleting Sales Header in codeunit 80.
The Sales Header table is not used in any of the reports printed during Poste Print. (It’s basically the Sales – Invoice report, the Sales – shipment report and a label report from the Report Selections table)
But there is some other strange subjects:
The customer has run with this setup for years with no problem, there is so far only one workstation where the error occurs and it began after re installation of the NAV Client.
The Sales Header which doesn't exist is not the sales Header there is about to be posted but it refers to a Sales Order which is deleted.
The order is posted but not printed.
The error dos not always occur but I have not so far find out in which conditions it appears.
The debugger dos not give me anything. It stops in the:
“
IF NOT ShowInternalInfo THEN
CurrReport.BREAK;
“
In the dimension loop data item. (Standard NAV) where ShowInternalInfo is a boolean constant always FALSE in this case.
Best Regards
Lars W Hald0 -
Check the Document Dimension table for dimensions for the deleted order. It seems that some lines in this table are reffering deleted record and thus leading to this error.0
-
We used to have identical report copies printing from Sales Header then from Invoiced version and then the same from ledgers...
final solution was to create a separate table that tells the system that there is data to be printed ( no matter where it came from ) and then print it at any moment it is convinient for the user to print or/and to reprint it0
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