how to skip dataitem

charles.rooscharles.roos Posts: 60Member
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;


  • ErictPErictP Posts: 95Member
    Try CurrReport.SKIP
  • charles.rooscharles.roos Posts: 60Member
    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?
  • AlbertvhAlbertvh Posts: 501Member
    if this is an indented dataitem you could use CurrReport.BREAK;

  • charles.rooscharles.roos Posts: 60Member
    Albertvh wrote:
    if this is an indented dataitem you could use CurrReport.BREAK;


    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.
  • ara3nara3n Posts: 9,174Member
    Yes it's currreport.break
    Ahmed Rashed Amini

  • SobyOneSobyOne Posts: 20Member
    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

    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.
    _\~ () ]3 `/ () |\| [-
Sign In or Register to comment.