Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Karl-Heinz" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Best way to find out where a field is changed Date: Wed, 8 Nov 2017 15:32:45 +0100 Lines: 64 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: individual.net kNmk/W/1BHTtWm5VN1t5Ogh7X8jkmjiDKn3vUFH6oRVbXrPGQ= Cancel-Lock: sha1:lV7McGkjwiBZsvXaRVDpqSb1IyY= In-Reply-To: X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216 Xref: csiph.com comp.lang.clipper.visual-objects:11136 Hi Dick, > We have the following issue. On rare occasions a field in an invoice > table contains a different currency than it should contain. >[...] > I wonder what the best way would be to find out from where this field is > changed. As we use ADS (in conjunction with separate DBF files) we may be > helped with triggers but I never worked with these. Does anyone have > experience with it? I have no experience with ADS triggers, but have you tried to trap the server Notify() messages ? Though my stack list shown wasn´t that clean as expected, i was able to identify that my #vorgang field change was initiated by a [Save] Pushbutton that writes the content of several controls to the server. METHOD Notify ( kNotifyName, uDescription) CLASS dbAufgaben IF kNotifyName == NotifyFieldchange .AND. uDescription == #VORGANG IF AllTrim ( SELF:FIELDGET ( #VORGANG ) ) != "xyz" // something went wrong ... // now list the procname() stack. MsgInfo ( "Wrong value: '" + AllTrim( SELF:FIELDGET ( #VORGANG )) + "'" + crlf + ; "Should be: 'xyz' ") ListStack() ENDIF ENDIF RETURN SUPER:Notify ( kNotifyName, uDescription) ----------------- FUNCTION ListStack() AS VOID PASCAL LOCAL dwActivation := 1 AS DWORD DO WHILE Psz2String(ProcName( dwActivation)) != NULL_STRING DebOut32 ( DToC ( Today()) + " " + Time() + " " + ProcFile(dwActivation) + " " + Psz2String ( ProcName(dwActivation) ) + " " +; "(" + NTrim(ProcLine(dwActivation))+ + ")" ) dwActivation ++ ENDDO RETURN regards Karl-Heinz