how to skip dataitem

charles.roos
Member Posts: 60
How to skip dataitem?
I tried to put skipping into OnPreDataItem-trigger with putting data excluding filter (1..-1) on the dataitem, i tried both filtergroups 0 and 2, i think, and still dataitem is processed, GLEntryEmptyGD1C - OnAfterGetRecord() is executed. How to skip dataitem then?
GLEntryEmptyGD1C - OnPreDataItem()
IF GLEntryForCopyingFilters.GETFILTER("Global Dimension 1 Code") <> '' THEN BEGIN
//don't show GLEntryEmptyGD1C, don't show IntegerEmptyGD1cALG0
GLEntryEmptyGD1C.SETRANGE(GLEntryEmptyGD1C."Entry No.",1,-1);//don't show data item
SkipIntegerEmptyGD1cALG0 := TRUE;
EXIT;
END;
I tried to put skipping into OnPreDataItem-trigger with putting data excluding filter (1..-1) on the dataitem, i tried both filtergroups 0 and 2, i think, and still dataitem is processed, GLEntryEmptyGD1C - OnAfterGetRecord() is executed. How to skip dataitem then?
GLEntryEmptyGD1C - OnPreDataItem()
IF GLEntryForCopyingFilters.GETFILTER("Global Dimension 1 Code") <> '' THEN BEGIN
//don't show GLEntryEmptyGD1C, don't show IntegerEmptyGD1cALG0
GLEntryEmptyGD1C.SETRANGE(GLEntryEmptyGD1C."Entry No.",1,-1);//don't show data item
SkipIntegerEmptyGD1cALG0 := TRUE;
EXIT;
END;
0
Comments
-
Try CurrReport.SKIP0
-
ErictP wrote:Try CurrReport.SKIP
I tried, it doesn't work.
CurrReport.SKIP is used only in "OnAfterGetRecord"-trigger, in no other trigger. My porpouse is to avoid going to "OnAfterGetRecord"-trigger at all, so i suggest to use "OnPreDataItem"-trigger, but how?0 -
Hi
if this is an indented dataitem you could use CurrReport.BREAK;
Albert0 -
Albertvh wrote:Hi
if this is an indented dataitem you could use CurrReport.BREAK;
Albert
Are you sure this is right instruction to ignore dataitem?
I understand it stops only execution of next lines in a trigger-function, but still the data item is walked through, AfterRecord-trigger would run as many times as there is data records. The better would be to somehow tell something like:
DataItem.MaxIteration = 0;
BREAK (Dataport, Report, XMLport)
Use this function to exit from a loop or a trigger in a data item trigger of a dataport, report or XMLport.0 -
Yes it's currreport.break0
-
CurrReport.Break is the correct command for skipping a data item (generally) once you are in the OnAfterGetRecord();
You can also create an unreasonable filter in the OnPreDataItem() which will cause the OnAfterGetRecord() to be skipped.
The only problem using CurrReport.Skip is that it must be in the OnAfterGetRecord() section and you will still be reading the data from the server, which consumes network bandwidth.
When in doubt, choose:
GLEntryEmptyGD1C - OnPreDataItem()
IF GETFILTER("Global Dimension 1 Code") <> '' THEN
CurrReport.Break;
Note the change to NOT indicate the data item. It's implied and sometimes helps when debugging because property changes on the dataitem (the name of the data item) will break a fully qualified line of code.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