Re: Forms 4.5 Question

From: Ashok Upadhyay <aupadhyay_at_earthlink.net>
Date: Thu, 05 Nov 1998 20:45:34 -0500
Message-ID: <364254BE.1301AE2F_at_earthlink.net>


Hi Albert,

Do not use default_value property it applies only when a new record is created and you set some value as a item's default value at design time. Instead use the select statement to directly get the value into defined display item. or assign as below :

:display_item := Messagetext
In your case
:STATUSTEXT := MESSAGE (Do nto use message it is a reserved word).

Hope this helps
Ashok

Madhu Cherukuri wrote:

> I'm not sure if this has to do some thing
> with the properties of the display item.
>
> You can still use the new-item-instance trigger
> with code like this
>
> Begin
> select text into :BLOCK.STATUSTEXT
> from TEXT
> where your_condition;
>
> exception
> when no_data_found then
> code to handle when there is no data
> when too_many_rows then
> code to handle when there are more than one row
> End;
>
> This should work. If it is not working,
> then check for display properties of the item.
> Also, check the secure property. set it to false.
>
> You can also debug by putting some message
> command after you fetch the text into the field
> like this.
>
> message(:BLOCK.STATUSTEXT); pause
>
> This will display the value of the text. put this
> code after the code as i had mentioned above.
>
> This will tell you whether the text is assigned to the
> display item or not
>
> Good luck
>
> Madhu Cherukuri
>
> "Liptay, Albert" wrote:
>
> > Hi All,
> >
> > Well, I'm new to Forms (Developer/2000) and here is my question:
> >
> > I've got a form with a bunch of graphs in it and that is all working
> > well. I want to display some text retrieved from a table and can't get
> > it to work.
> >
> > I created a Display Item (from the help I'm assuming that's what I need)
> > and then created a WHEN-NEW-ITEM-INSTANCE trigger to populate the item.
> >
> > Here is my code for the trigger:
> >
> > declare
> > it_id Item;
> > message CHAR(256);
> > begin
> > it_id := Find_Item('STATUSTEXT');
> > select text into message from status_text;
> > SET_ITEM_PROPERTY(it_id, DEFAULT_VALUE, message);
> > end;
> >
> > Unfortunately this isn't working, I guess I don't know if I can use
> > SET_ITEM_PROPERTY to set the value of the Display Item (in this case
> > STATUSTEXT) and secondly, what the field I want to specify is.
> >
> > Any Ideas or help would be really appreciated.
> >
> > Thanks,
> > Albert Liptay.
Received on Fri Nov 06 1998 - 02:45:34 CET

Original text of this message