Post & Print - Sales Invoice
omyvadiya
Member Posts: 124
Hi,
I am trying to use the standard Post & Print option that is on Sales Invoice Page. I am getting the following error:
Microsoft Dynamics NAV
The Sales Invoice Header does not exist. Identification fields and values: No.='XYZ1812RI0016'
OK
In Demo database its working fine, but in my database it is showing the above error.
The Sales Post and Print cdu is not customized.
On debugging it is getting stuck in the .Get function mentioned in the below code:
DocumentRecordRef.GETTABLE(HeaderDoc);
CASE DocumentRecordRef.NUMBER OF
DATABASE::"Sales Invoice Header":
BEGIN
SalesInvoiceHeader := HeaderDoc;
SalesInvoiceHeader.SETRANGE("No.",SalesInvoiceHeader."No.");
SalesInvoiceHeader.GET(SalesInvoiceHeader."No.");
SetCustomReportSelectionRange(
I am trying to use the standard Post & Print option that is on Sales Invoice Page. I am getting the following error:
Microsoft Dynamics NAV
The Sales Invoice Header does not exist. Identification fields and values: No.='XYZ1812RI0016'
OK
In Demo database its working fine, but in my database it is showing the above error.
The Sales Post and Print cdu is not customized.
On debugging it is getting stuck in the .Get function mentioned in the below code:
DocumentRecordRef.GETTABLE(HeaderDoc);
CASE DocumentRecordRef.NUMBER OF
DATABASE::"Sales Invoice Header":
BEGIN
SalesInvoiceHeader := HeaderDoc;
SalesInvoiceHeader.SETRANGE("No.",SalesInvoiceHeader."No.");
SalesInvoiceHeader.GET(SalesInvoiceHeader."No.");
SetCustomReportSelectionRange(
0
Answers
-
which object is this that is having error?
United Kingdom0 -
HeaderDoc is not a std. NAV variable name.
This is a modification.0 -
Table - 9657 (Custom Report Selection), PrintCustomReports function0
-
-
Hi,
I am trying to use the standard Post & Print option that is on Sales Invoice Page. I am getting the following error:
Microsoft Dynamics NAV
The Sales Invoice Header does not exist. Identification fields and values: No.='XYZ1812RI0016'
OK
In Demo database its working fine, but in my database it is showing the above error.
The Sales Post and Print cdu is not customized.
On debugging it is getting stuck in the .Get function mentioned in the below code:
DocumentRecordRef.GETTABLE(HeaderDoc);
CASE DocumentRecordRef.NUMBER OF
DATABASE::"Sales Invoice Header":
BEGIN
SalesInvoiceHeader := HeaderDoc;
SalesInvoiceHeader.SETRANGE("No.",SalesInvoiceHeader."No.");
SalesInvoiceHeader.GET(SalesInvoiceHeader."No.");
SetCustomReportSelectionRange(
weird code GET after setrange as doing pretty much same thingUnited Kingdom0 -
"On debugging it is getting stuck in the .Get function mentioned in the below code:"
The get I 'get'. Set the pointer after setting the filter.
|You should focus on the place from where PrintCustomReports is called as shown in de debugger.0 -
Try adding the code on the beginning of the function.
message('%1',headerdoc.isrecord);
Is it an actual record in the Var?
It probably is.. sales invoice header, but give it a try.0 -
Is SalesInvoiceHeader."No." having the correct value?0
-
yes the document no. that is passing in SalesInvoiceheader.No. is correct0
-
Was there any database corruption? Try rebuilding indexes.0
-
Nopes, there isn't any database corruption0
-
Below the code from CU82.
SalesInvHeader."No." := "Last Posting No.";
This I do not trust, probably the reason
Try to add
SalesInvHeader.FIND;
IF Invoice THEN BEGIN
SalesInvHeader."No." := "Last Posting No.";
SalesInvHeader.SETRECFILTER;
CustomReportID := CustomReportSelection.PrintCustomReports(SalesInvHeader,SendReportAsEmail,FALSE);
IF CustomReportID = 0 THEN
PrintReport(ReportSelection.Usage::"S.Invoice");
END;
0 -
Try rebuilding indexes. As its standard code I suspect that could be the case - db corruption. You can do it from development environment untick maintain index for the corresponding key ( No. ?). save the table and tick again and save the table.0
-
So this probably means that the "Last Posting No." is not correct.
In theory it is possible that NAV starts posting an invoice, fills the last posting no.
but has a rollback due to an error while posting.
The value for last posting no stays in the table, but the invoice does not exist.
I've 'misused' this field many times, so It could be that NAV was adjusted to fill this field differently.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

