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;
0
Comments
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?
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.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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.
http://www.SobyLand.com
651-815-0698