Jump to content

Q : Why is 'append new record' canceld


mierlp

Recommended Posts

After the user appends a record i do a OnBeforePost check to see if all fields are filled.

 

I use this code (like in all my Delphi projects) :

 

if length(dmPortal.Gast.FieldbyName('LastName').asString) =0 then begin

   sSenderComponent:='uniDBEdit_LastName';

   MessageDlg('You have to fill the LASTNAME, mtInformation, [mbOK], MessageComponentFocus';

   Abort;

end;

 

 

Then the MEssageComponentFocus:

 

Procedure TdmPortal.MessageComponentFocus(Sender: TComponnt; Res: Integer);

begin

   if sSenderComponent='uniDBEdit_LastName' then begin

      FormRegistrationGuest.uniDBEdit_LastName.SetFocus

 

   end;

end;

 

 

For some reason the append will be canceld...which my not be done by the

ABORT. This code works in Delphi application and should also work
in uniGui.

 

Sugguestions/tips please...i use latest version/build (0.97.1077)

 

Regards Peter

Link to comment
Share on other sites

Hi

 

The database which is connected to the DB fields is also connected to

the dbgrid and should not be problem (compared to a Win32 application)

 

How looks you code Farshad...because the abort may not canceld

the append...it just has to 'abort' the action...this is normal behavior ?

 

I use the same principle as with win32 apps...and i know not all may

compaire...but i don't give a : dmPortal.Gast.CANCEL command

so...till then the append must be 'alive'

 

The abort is also cancelling the append what you normally do with dmPortal.gast.CANCEL

(like the above sample)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...