Source language: Translate to:

Is there an OnRecordChange or OnTableNavigate trigger?

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Is there an OnRecordChange or OnTableNavigate trigger?

Postby Enigman » Sun Jan 19, 2014 12:02 am

I am looking for a way to fire a subroutine whever I navigate to a different record. I'm not talking about the one that triggers a subroutine when the table is changed. I want to fire the subroutine only when the navigation is used such as using any Next, Previous, Last function, etc.

I want to do a lookup on a small secondary table to see if a field in the current record is in the small secondary table. If it is, then I want to change the background color of the text box containing the field in question. In other words, I want to see if a person's name in my sales table is on a black list, and if so, turn the name field red.

Anyone done anything like this?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: Is there an OnRecordChange or OnTableNavigate trigger?

Postby Gaev » Sun Jan 19, 2014 7:12 am

Enigman:
I want to do a lookup on a small secondary table to see if a field in the current record is in the small secondary table. If it is, then I want to change the background color of the text box containing the field in question. In other words, I want to see if a person's name in my sales table is on a black list, and if so, turn the name field red.

So, whenever you/user navigates to a different Person record in the Grid (via mouse click or keyboard shortcut) ... you want to trigger a subroutine that checks the Sales Table for a match ?

If so, from the Help file ...
dbpOpenTable "database id" "table" "subroutine"

subroutine
The name of a subroutine from your publication's Subroutine Action. The subroutine specified here will be automatically executed whenever the table is updated or the current record number changes. This can be useful if you want to activity to take place whenever the reader displays a different record.

So you would name your subroutine for the dbpOpenTable command for the Person Table.

If this is not what you are looking for, please explain further.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Is there an OnRecordChange or OnTableNavigate trigger?

Postby Enigman » Sun Jan 19, 2014 8:35 am

Gaev,

Thanks for the reply.

Apparently I missed the help text part where it says "or the current record number changes". :oops: I saw that parameter from the action command itself and thought it was just going to fire when any field content was changed.

I'll give that a shot.

I sell products online in several venues and badly behaved buyers can be a real problem, so I want the database to warn me if one of them returns and buys again. Checking a "blacklist" table will help solve that. I also want to know when "good" repeat buyers show up again so I can consider rewards.

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest