Re: Forms 4.5 Control item update HELP!!!!!!

From: Neville Sweet <sweet.neville.nj_at_bhp.com.au>
Date: 1997/12/04
Message-ID: <01bd0062$5b2fdba0$38f11286_at_itwol-pc3963.itwol.bhp.com.au>#1/1


John,

You were right about control items and the record status. Changing a control item does not normally affect the Record Status.

It took me a while to comprehend your comments so it may be worth explaining for the benefit of others:

My Forms display text values rather than numeric keys, eg. Customer Name instead of the Id.
A Post-Query trigger selects the Name from a lookup table. During user input, if the Name is changed then the new Id. must be determined. A When-Validate-Item is used which selects the Id associated with the Name.
It was found that after Post-Query processing the Record Status was set to 'CHANGED'. Evidently, Post-Query set the Name which in turn caused the When-Validate-Item to fire which looked up the Id. again, which sets the Record Status to 'CHANGED' because a base table item was modified. Our solution was to set the Record Status back to 'QUERY', the last statement in Post-Query processing.
Apparently, issuing a Set_Record_Property(...'QUERY_STATUS') suppresses the firing of the When-Validate-Item triggers during Query processing.

That said, I believe my other points are still valid.

> Forms DOES NOT recognize a CONTROL item has changed.
>
In the context of Record Status, yes that's true. It's worth stating, however, that a When-Validate-Item on a control item DOES fire when navigating from the control item after it is modified. A control item with Lock Record property = True forces the Record Status to be set to 'CHANGED' and the base table row to be locked. The 'On' triggers, On-Lock etc, can be used to maintain multiple tables. The Lock Record property must be set to False before populating the control item in a Post-Query.

> >If the control item belongs to a table you want to....
>
> By definition a control item does not belong to a table.
>
> You are confusing a control item with a foreign key lookup item...

I disagree. By definition, a control item is ANY item that has Base Table property = False. This includes foreign key look-up fields. Whoever wrote Forms Help took this view.

>
> Rather, wrap your validations in an IF construct to prevent
> validation during query.
>
> IF :system.mode <> 'QUERY' THEN
> -- do the validation
> END IF;
>

Perhaps this is a better approach than ours, which presumes that When-Validate-Item will always fire after the Post-Query trigger (rather than during).

Thanks for your input - this has clarified a bad assumption and (hopefully) prevented its propagation.
Neville. Received on Thu Dec 04 1997 - 00:00:00 CET

Original text of this message