Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnValidate event failed. #77

Open
rcloayza opened this issue Jan 19, 2024 · 0 comments
Open

OnValidate event failed. #77

rcloayza opened this issue Jan 19, 2024 · 0 comments
Assignees

Comments

@rcloayza
Copy link

I have several persistent fields in TpfIBDataset.
In some of them I incorporated validations using OnValidation.
When this event is triggered, the entered value is replaced by the value of another field without any explanation.

procedure TfrmAreasPrincipal.ParamsimDENSValidate(Sender: TField);
begin
//Sender.Value=> 1250
//ParamSimEDAD_I.Value=>5
//ParamSimID_ZON.AsInteger=>1

   If (ParamSimEDAD_I.Value=0) Then
       Exit;
   //Sender does not intervene here In SetRange
   SetRanges(ParamSimID_ZON.AsInteger, ParamSimEDAD_I.AsInteger);

   //After SetRanges change value to Sender.Value

  //Sender.Value                         => Set value to 5 ERROR!!!
  //ParamSimEDAD_I.Value        =>5
  //ParamSimID_ZON.AsInteger=>1

  if Sender.AsFloat<1000 then
    raise exception.create('Error value');

end;
Does anyone know what could be happening and how to correct this anomaly?

Delphi 10.2
thank you
Christian Loayza

@madorin madorin self-assigned this Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants