Once you have applied filters to a variable and performed your operations, you may want reuse that variable. Here we will show you how to remove any actions you may have done to it.
Create a new codeunit from Object Designer.
Add the following global variable:
Name
Type
Subtype
Customer
Record
Customer
Add the following code to the
OnRun
trigger of the codeunit:Customer.SETCURRENTKEY(Name); Customer.SETFILTER(Name, 'Matt'); Customer."No." := 'Num'; Customer.RESET; MESSAGE('Current Key: %1\Name Filter: %2\Customer No.: %3', Customer.CURRENTKEY, Customer.GETFILTER(Name), Customer."No."); Customer.SETCURRENTKEY(Name); Customer.SETFILTER(Name, 'Matt'); Customer."No." := 'Num'; CLEAR(Customer); MESSAGE('Current Key: %1\Name Filter: %2\Customer No.: %3', Customer.CURRENTKEY, Customer.GETFILTER(Name), Customer."No.");
Save and close the codeunit.
When you run the codeunit you will see windows like the following: