It looks like you're new here. If you want to get involved, click one of these buttons!
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.
When used inside a loop - such as a WHILE..DO or REPEAT..UNTIL construction - BREAK causes the execution of the loop to end, and control will return to the statement that immediately follows the loop.
When used outside a loop, BREAK causes the execution of the current trigger to end.
Compare also with the QUIT function.
The following shows how to use the BREAK function:
Myvar := Myvar +1;
IF Myvar = 5 THEN
UNTIL Myvar = 10
Create the following text constant in the C/AL Globals window:
'Myvar is now %1'
When this code is run, the execution of the loop will end when MyVar is 5.
SKIP (Dataport, Report, XMLport)
Use this function to skip the current iteration of the current dataport, report or XMLport.
While you can use SHOWOUTPUT to suppress printing the output from a section in a report, SKIP allows you to suppress any processing at all and move on.
If you perform some processing in the OnAfterGetRecord trigger of a data item, and do not want this processing to take place in some situations, you can use SKIP in this way:
IF Balance = 0 THEN
... // some processing
A typical situation where you will use SKIP like this is when you want to retrieve records from a related table, using values in the current record for forming a filter. If the values in the current record already indicate that no records from the related table will be retrieved, there is no need to perform this processing - and you can use SKIP to avoid it.
I still have doubts in this. What if i have 5 dataitems A-E and B is indented under A, C is indented under B. D & E are indented under A. On Request option form i placed a boolean, if this is true than only B and D Should process. If i place at OnPreDataitem() of B and D, CurrReport.break, will it go and process the Data Item E if the boolean is false?