Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #11131 > unrolled thread

Best way to find out where a field is changed

Started byD.J.W. van Kooten <vankooten@removethis.ic2.com>
First post2017-11-07 15:32 +0100
Last post2017-11-16 18:14 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Best way to find out where a field is changed D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2017-11-07 15:32 +0100
    Re: Best way to find out where a field is changed "Karl-Heinz" <invalid@invalid.invalid> - 2017-11-08 15:32 +0100
      Re: Best way to find out where a field is changed D.J.W. van Kooten <vankooten@removethis.ic2.com> - 2017-11-16 23:34 +0100
    Re: Best way to find out where a field is changed "Jamal" <noooospam@example.com> - 2017-11-16 18:14 -0500

#11131 — Best way to find out where a field is changed

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2017-11-07 15:32 +0100
SubjectBest way to find out where a field is changed
Message-ID<ljg30ddi7e7rmdadn6v057r7khg9ji2fg8@4ax.com>
We have the following issue. On rare occasions a field in an invoice
table contains a different currency than it should contain. On every
database change, we call a function which creates an SQL query. We
checked every place where this field is changed in the program and all
were followed by a call to this function. The SQL query database
contains one INSERT and multiple UPDATE statements on the specific
record but all show the original currency and not the one we finally
see in the database.

So there must be something we overlooked. 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?

Dick

[toc] | [next] | [standalone]


#11136

From"Karl-Heinz" <invalid@invalid.invalid>
Date2017-11-08 15:32 +0100
Message-ID<f6giuaFp5v3U1@mid.individual.net>
In reply to#11131
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 

[toc] | [prev] | [next] | [standalone]


#11148

FromD.J.W. van Kooten <vankooten@removethis.ic2.com>
Date2017-11-16 23:34 +0100
Message-ID<9q3s0dl797jgbinj4a2tpop3fvp6r2gqpf@4ax.com>
In reply to#11136
Replying on message of Wed, 8 Nov 2017 15:32:45 +0100 from Karl-Heinz:


 Hello Karl-Heinz,

>I have no experience with ADS triggers, but have you tried to trap the
>server Notify() messages  ? 

Thanks for your code. I tried it and it appears that only a few field
changes actually trigger this check being some date/time/user changed
fields I modify directly. The rest of the code is using Gather/Scatter
to read / fill dbf fields  to  / from screen controls. And the changes
written there do not trigger this notify at all.

I also found that ADS triggers only work with data dictionaries and
ADT files so I'm a bit out of options.

Dick

[toc] | [prev] | [next] | [standalone]


#11149

From"Jamal" <noooospam@example.com>
Date2017-11-16 18:14 -0500
Message-ID<oul64i$6ig$1@news.albasani.net>
In reply to#11131
>>
On rare occasions a field in an invoice
table contains a different currency than it should contain. <<

What is column type? Is this is in an SQL table or in a DBF file

What do you pass save into the column and what do you see after?

Jamal

"D.J.W. van Kooten"  wrote in message 
news:ljg30ddi7e7rmdadn6v057r7khg9ji2fg8@4ax.com...

We have the following issue. On rare occasions a field in an invoice
table contains a different currency than it should contain. On every
database change, we call a function which creates an SQL query. We
checked every place where this field is changed in the program and all
were followed by a call to this function. The SQL query database
contains one INSERT and multiple UPDATE statements on the specific
record but all show the original currency and not the one we finally
see in the database.

So there must be something we overlooked. 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?

Dick 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web