Report items on the same line

sp4tc
Member Posts: 16
I am trying to create a report that shows inventory against Global Dimension 1 to get the ship to address the inventory was produced for, so far I have
The problem is that Global Dimension one is out of sync with the other fields by one line and I do not know why.
Can anyone help?
Thanks in advance.
OBJECT Report 50042 Inventory Availability { OBJECT-PROPERTIES { Date=16/05/08; Time=13:57:13; Modified=Yes; Version List=SP40001; } PROPERTIES { CaptionML=[ENU=Inventory Availability; ENG=Inventory Availability]; } DATAITEMS { { PROPERTIES { DataItemTable=Table27; DataItemTableView=SORTING(No.) WHERE(Inventory=FILTER(>0), Item Category Code=FILTER(FIN*)); PrintOnlyIfDetail=Yes; OnAfterGetRecord=BEGIN tnavref :=''; tno :=''; tdesc :=''; tno := Item."No."; tdesc := Item.Description; tqty := Item.Inventory; tnavref := "Item Ledger Entry"."Global Dimension 1 Code" END; ReqFilterFields=No.; } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=18600; SectionHeight=846; } CONTROLS { { 1040001;Label ;0 ;0 ;1500 ;846 ;ParentControl=1040000; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 1040003;Label ;1650 ;0 ;4500 ;846 ;ParentControl=1040002; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 1040005;Label ;6300 ;0 ;1800 ;846 ;ParentControl=1040004; HorzAlign=Right; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes } { 1040009;Label ;8250 ;0 ;4500 ;846 ;ParentControl=1040008; VertAlign=Bottom; FontBold=Yes; MultiLine=Yes; CaptionML=ENG=NavRef } } } { PROPERTIES { SectionType=Body; SectionWidth=18600; SectionHeight=423; } CONTROLS { { 1040000;TextBox ;0 ;0 ;1500 ;423 ;SourceExpr=tno } { 1040002;TextBox ;1650 ;0 ;4500 ;423 ;SourceExpr=tdesc } { 1040004;TextBox ;6300 ;0 ;1800 ;423 ;SourceExpr=Inventory } { 1040008;TextBox ;8250 ;0 ;4500 ;423 ;SourceExpr=tnavref } } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table32; DataItemTableView=SORTING(Item No.,Posting Date); DataItemLink=Item No.=FIELD(No.); } SECTIONS { { PROPERTIES { SectionType=Body; SectionWidth=18600; SectionHeight=0; } CONTROLS { } } } } { PROPERTIES { DataItemIndent=1; DataItemTable=Table36; DataItemTableView=SORTING(Document Type,No.); DataItemLinkReference=Item Ledger Entry; DataItemLink=Shortcut Dimension 1 Code=FIELD(Global Dimension 1 Code); } SECTIONS { { PROPERTIES { SectionType=Header; SectionWidth=18600; SectionHeight=0; } CONTROLS { } } { PROPERTIES { SectionType=Body; SectionWidth=18600; SectionHeight=0; KeepWithNext=No; } CONTROLS { } } } } } REQUESTFORM { PROPERTIES { Width=3850; Height=440; SaveValues=Yes; } CONTROLS { } } CODE { VAR tnavref@1040001 : Text[30]; tno@1040000 : Text[30]; tdesc@1040002 : Text[30]; tqty@1040003 : Decimal; BEGIN { } END. } }
The problem is that Global Dimension one is out of sync with the other fields by one line and I do not know why.
Can anyone help?
Thanks in advance.
0
Comments
-
You cannot use "Item Ledger Entry" in the Item dataitem, because the OnAfterGetRecord of Item is processed before the Item ledger entry dataitem. It means that first iteration you are assigning the uninitialized variable and next iteration you are using the "undefined" variable (but in real it is last record from previous loop of the Item Ledger Entry).0
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