MARK Function (Record)

Marks a record. You can also use this function to determine if a record is marked.


[IsMarked :=] Record.MARK([SetMarked])

Parameters

Record

Type: Record

The input record.

SetMarked

Type: Boolean

If this parameter is true, the function will mark the record. (Previously marked records remain marked.)

If this parameter is false, the function will remove any mark.

Type: Boolean

true if the record is marked; otherwise, false.

The mark is effective until the application stops executing.

This example shows how to use the MARK function. Assume that initially no records are marked.

This example requires that you create the following text constant in the C/AL Globals window.

Text constant ENU value

Text000

'Customer.No.: %1, Marked?: %2'

Customer.SETCURRENTKEY("No.");
Customer."No." := 'NEW 3500';
Customer.FIND('=');
Customer.MARK(TRUE); // Mark a record.
Customer.FIND('-'); // Find first record.
REPEAT // Go through records
Marked := Customer.MARK; // Test if marked.
MESSAGE(Text000, Customer."No.", Marked);
UNTIL Customer.NEXT = 0;

The message windows could show the following:

Customer No.: AAA 1050, Marked?: No

Customer No.: DEL 3500, Marked?: No

Customer No.: NEW 3500, Marked?: Yes

Customer No.: PEA 2500, Marked?: No

Customer No.: SOP 7500, Marked?: No

This example shows how to use the MARK function with the MARKEDONLY function. Assume that initially no records are marked.

This example requires that you create the following text constants in the C/AL Globals window.

Text constant ENU value

Text001

'Number of records before MARKEDONLY: %1\'

Text002

'Number of records after MARKEDONLY: %2'

SETCURRENTKEY(Customer."No.");
Customer."No." := 'NEW 3500';
FIND(Customer, '=');
MARK(Customer, TRUE); //Mark a record. 
No1 := COUNT(Customer);
MARKEDONLY(Customer, TRUE);
No2 := COUNT(Customer);
MESSAGE(Text001 + Text002, No1, No2);

The message windows could show the following:

Number of records before MARKEDONLY: 5

Number of records after MARKEDONLY: 1

Community Additions

ADD
Show: