2
I have a DataSet
that returns multiple rows and in one of the columns I have the Situação
of the record that may be: open, closed, in conference, conferred, finalized...
I need to check if there’s a situation that isn’t conferido
, tried the Locate
direct with the check, but the way I did it won’t work.
Another possibility would be to make a Locate
for each of the situations to apply the restriction, but would like something better than to do several IFs
.
if not dmContratoEmpresarial.cdsContratoEmpresarialContratos.Locate('SITUACAO', 'CONFERIDO', []) then
fMensagem.Adicionar('Os contratos não foram todos conferidos');
Why do you use a query and make a select? Selects all records of those contracts that have different check status. If you return any, you know that you have unselected contracts. In addition, select is much faster than Locate.
– Reginaldo Rigo