Re: Need trigger for form.

From: Tiago Rocha <tiagocrspamtalho_at_terra.com.br>
Date: Fri, 21 Nov 2003 15:23:47 -0300
Message-ID: <jnlsrv0mo8i5ck6qvbg2p4rngtp8nri7e6_at_4ax.com>


[Quoted] [Quoted] On 20 Nov 2003 13:48:48 -0800, mhamilton_at_usgs.gov (M Hamilton) wrote:

>In Designer6i I have created a form that has an action item (button)
>that when pressed calls the CANCEL procedure. The CANCEL procedure
>changes the value of a database column (STATUS_CODE) from 'AUTHORIZED'
>to 'CANCELED'. What trigger can I use at the block level that will
>update the block on the form and display the new value in the field?
>
>I tried using POST-UPDATE with this code:
>BEGIN
> select status_code
> into :it_gdaps_mc.status_code
> from items_gdaps
> where rowid = :it_gdaps_mc.rowid;
>END;
hi. I'm a long time lurker on this group and will step out of the shadows and try to answer...

You have a update statement on the button when-button-pressed code? Is the block a base-table block?

if the block is base table and the field is a base table item, you don't need to perform a manual update. Just assign the value to the field, on the "when-button-pressed" trigger, just type the following code:

:it_gdaps_mc.status_code := 'Disabled' ;

if you need auto-commit, issue a "commit" right after that line above. You may want change the system message level to avoid messages...

>It did not requery the database and display the new values.

the built in "execute-query" is what you want to requery...

>Thanks in advance,
>MH

hth.

-- 
Tiago Rocha
Recife - Brasil
www.diariodastrilhas.cjb.net
Received on Fri Nov 21 2003 - 19:23:47 CET

Original text of this message