Scenario:
I have a master detail link between inventory and inventory detail.
I add a filter to my inventory details.
I get a 'record not found' error, though 1 record should have been returned (it's in the data).
'Record not found' error
In what moment does the problem arise: on setting the filter, refreshing a record, editing a record, etc?
What kind of filter do you use: filter on the client side (using Filter and Filtered properties), or filter on the server side (using an additional condition in your query, or using the AddWhere method).
What kind of filter do you use: filter on the client side (using Filter and Filtered properties), or filter on the server side (using an additional condition in your query, or using the AddWhere method).
My code:
if tblInvenDetail.MasterSource dsInventory then
begin
tblInvenDetail.MasterSource := nil;
if tblInvenDetail.DetailFields 'ItemUID' then
tblInvenDetail.DetailFields := 'ItemUID';
tblInvenDetail.MasterFields := 'UID';
tblInvenDetail.MasterSource := dsInventory;
end;
isFound := false;
if aUID '' then
begin
tblInvenDetail.Filter := 'UID = ' + quotedStr(aUID);
tblInvenDetail.Filtered := true;
TableOpen(tblInvenDetail); ---> blow up.
IsFound := not tblInvenDetail.IsEmpty;
end;
if tblInvenDetail.MasterSource dsInventory then
begin
tblInvenDetail.MasterSource := nil;
if tblInvenDetail.DetailFields 'ItemUID' then
tblInvenDetail.DetailFields := 'ItemUID';
tblInvenDetail.MasterFields := 'UID';
tblInvenDetail.MasterSource := dsInventory;
end;
isFound := false;
if aUID '' then
begin
tblInvenDetail.Filter := 'UID = ' + quotedStr(aUID);
tblInvenDetail.Filtered := true;
TableOpen(tblInvenDetail); ---> blow up.
IsFound := not tblInvenDetail.IsEmpty;
end;