i have tztable (zeoslib) bound dbgrid need know particular tfield changed user.
i tried
if not (tapositionenartnrgh.newvalue = tapositionenartnrgh.oldvalue) showmessage('articlenumber changed');
i placed code in
- beforepost, onupdaterecord, afterpost
but in debugger oldvalue newvalue. how check field changed?
you can use updatestatus : tupdatestatus
this. example:
- set ztable.cachedupdates true;
- create new calculated field named "status".
- to show old value example of field "fname" create new calculate field named "fnameoldvalue"
in oncalcfields event use:
procedure tdm1.ztable1calcfields(dataset: tdataset); begin if ztable1.updatestatus in [usmodified] begin ztable1status.value := 'modified'; ztable1fnameoldvalue.value := ztable1fname.oldvalue; end else ztable1status.value := 'unmodified' end;
result :
edit:
you can detect field level changes like:
if ztable1.updatestatus in [usmodified] begin := 0 ztable1.fields.count - 1 begin if ztable1.fields[i].oldvalue <> ztable1.fields[i].newvalue -- field end; end;
Comments
Post a Comment