Subject | OnValidateField I want field not blanked if wrong |
---|---|
Author | mmenaz |
Post date | 2001-12-11T15:12:32Z |
I've a code like:
if (AField.FieldName = 'CUSTOMER_CODE') then
begin
if not IsCustCodeOk(AField.AsString) then
raise Exception.Create( 'WRONG customer code' );
end;
When the error raises, the focus is put back to the offending control, but the field is blanked, making hard for the user to check and correct the long, maybe almost 99% correct, code.
How can I have the field value preserved?
Thanks
Marco Menardi
if (AField.FieldName = 'CUSTOMER_CODE') then
begin
if not IsCustCodeOk(AField.AsString) then
raise Exception.Create( 'WRONG customer code' );
end;
When the error raises, the focus is put back to the offending control, but the field is blanked, making hard for the user to check and correct the long, maybe almost 99% correct, code.
How can I have the field value preserved?
Thanks
Marco Menardi