var
SearchString: Text;
begin
Customer.FilterGroup := -1;
SearchString := '@*John*';
Customer.SetFilter(Customer.Name, SearchString);
Customer.SetFilter(Customer.Contact, SearchString);
end;
SELECT *
FROM Customer
WHERE (Name like @'John') OR
(Contact like @'John')
SELECT *
FROM Customer
WHERE (Name like @'John') AND
(Contact like @'John')
procedure CrossColumnSearchCustomers()
var
RecRef: RecordRef;
FieldRefVar: FieldRef;
Counter: Integer;
FilterTxt: Text;
begin
FilterTxt := '@*export*';
RecRef.Open(Database::Customer);
RecRef.FilterGroup(-1);
FOR Counter := 1 TO RecRef.FieldCount() DO BEGIN
FieldRefVar := RecRef.FieldIndex(Counter);
if FieldRefVar.Class() <> FieldClass::FlowFilter then
if (FieldRefVar.Type() in [FieldType::Code, FieldType::Text])
and (FieldRefVar.Length() >= StrLen(FilterTxt)) then begin
if FieldRefVar.Class() = FieldClass::FlowField then
FieldRefVar.CalcField();
FieldRefVar.SETFILTER(FilterTxt);
end;
end;
if RecRef.FindSet() then
repeat
Message(RecRef.GetPosition());
until RecRef.Next() = 0;
RecRef.Close();
end;
procedure ExcludeEntryFromSalesLine()
var
SalesLine: Record "Sales Line";
begin
//Full set of records, count is 33
message(Format(SalesLine.Count()));
SalesLine.FilterGroup(-1);
SalesLine.SetFilter("Document Type", '<>%1', SalesLine."Document Type"::Invoice);
SalesLine.SetFilter("Document No.", '<>%1', '103205');
SalesLine.SetFilter("Line No.", '<>%1', 20000);
//Set of records exlude one specific entry, count is 32
message(Format(SalesLine.Count()));
end;