mibuso.com

Microsoft Business Solutions online community
It is currently Thu Apr 24, 2014 5:03 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: how to skip dataitem
PostPosted: Tue Apr 15, 2008 3:09 pm 
Offline

Joined: Wed Jun 06, 2007 9:43 am
Posts: 39
Location: Estonia
Country: Estonia (ee)
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;


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 3:59 pm 
Offline

Joined: Thu Jun 10, 2004 10:54 am
Posts: 76
Location: Gouda
Country: Netherlands (nl)
Try CurrReport.SKIP


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 4:08 pm 
Offline

Joined: Wed Jun 06, 2007 9:43 am
Posts: 39
Location: Estonia
Country: Estonia (ee)
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 4:24 pm 
Offline

Joined: Fri Mar 14, 2003 9:18 am
Posts: 489
Location: Johannesburg
Country: South Africa (za)
Hi
if this is an indented dataitem you could use CurrReport.BREAK;



Albert


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 4:48 pm 
Offline

Joined: Wed Jun 06, 2007 9:43 am
Posts: 39
Location: Estonia
Country: Estonia (ee)
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 7:04 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8986
Location: 3rd rock from sun
Country: United States (us)
Yes it's currreport.break

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 12:49 am 
Offline

Joined: Thu Jun 15, 2006 4:18 pm
Posts: 20
Location: Minnesota
Country: United States (us)
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.

_________________
_\~ () ]3 `/ () |\| [-
http://www.SobyLand.com
651-815-0698


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: