Report ok in the first record wrong on the following records
nav_student
Member Posts: 175
Hi guys.
I am creating a report based on sales invoice header and line table.
I have not idented the ItemCrossReference so I use the GET function to get into the report some fields from the ItemCrossReference.
In the first Record information is OK but on the second it puts the same information of the first record from the ItemCrossReference.
Here is the Code:
Then on my Section:
Sales Invoice Line (3) I put the a textbox with a field from ItemCrossCeference.
What is missing?
Thanks.
I am creating a report based on sales invoice header and line table.
I have not idented the ItemCrossReference so I use the GET function to get into the report some fields from the ItemCrossReference.
In the first Record information is OK but on the second it puts the same information of the first record from the ItemCrossReference.
Here is the Code:
Sales Invoice Line - OnAfterGetRecord()
IF ICrossReference.GET("Sales Invoice Line"."No.","Sales Invoice Line"."Variant Code",
"Sales Invoice Line"."Unit of Measure Code",ICrossReference."Cross-Reference Type"::Customer,
"Sales Invoice Line"."Bill-to Customer No." ,"Sales Invoice Line"."Cross-Reference No.") THEN;
Then on my Section:
Sales Invoice Line (3) I put the a textbox with a field from ItemCrossCeference.
What is missing?
Thanks.
0
Comments
-
IF ICrossReference.GET("Sales Invoice Line"."No.","Sales Invoice Line"."Variant Code", "Sales Invoice Line"."Unit of Measure Code",ICrossReference."Cross-Reference Type"::Customer, "Sales Invoice Line"."Bill-to Customer No." ,"Sales Invoice Line"."Cross-Reference No.") THEN;
In this code if you Get then you do nothing.
But if your get fails you don't to anything. The variable is not cleared and it maintains the last values.
Try IF ICrossReference.GET(...) THEN BEGIN
END ELSE BEGIN
CLEAR(ICrossReference);
END;0 -
kapamarou wrote:
IF ICrossReference.GET("Sales Invoice Line"."No.","Sales Invoice Line"."Variant Code", "Sales Invoice Line"."Unit of Measure Code",ICrossReference."Cross-Reference Type"::Customer, "Sales Invoice Line"."Bill-to Customer No." ,"Sales Invoice Line"."Cross-Reference No.") THEN;
In this code if you Get then you do nothing.
But if your get fails you don't to anything. The variable is not cleared and it maintains the last values.
Try IF ICrossReference.GET(...) THEN BEGIN
END ELSE BEGIN
CLEAR(ICrossReference);
END;
I put GET to point to the Record on the ItemCrossReference.
I used the code that you mention.
The first record it returns sucessful.
Then in the 2nd record the information associated is blank.
I can i update the records 2 and the following records??
Thanks0 -
nav_student wrote:Then in the 2nd record the information associated is blank.
I can i update the records 2 and the following records??
Can you please elaborate more on this?0 -
Example:
Information on the tables
Item 1 - No. 123 -> ItemCrossReference.Description2 -> "Information about the item 1"
Item 2 - No. 999 -> ItemCrossReference.Description2 -> "Information about the item 2"
REPORT
Item No. Description2
123 Information about the item 1
999
On the Item2 with the Nº. 990 the information is not updated with the text "Information about the item2"0 -
I found it.
The user puts the ItemCrossReference No. on the 2nd item after the invoice has been register.
I check and this Item Cross Reference No. is empty, so it returns nothing and the value that is return is blank.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
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 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