Re: forms issues

From: <rtproffitt_at_my-deja.com>
Date: 2000/04/24
Message-ID: <8e1qnc$nv6$1_at_nnrp1.deja.com>#1/1


Jian Jun,
certainly I agree that Forms is difficult when you are a new beginner...Any kind of books, classes, or Computer Based Training would definitely help...because it is important that you become comfortable with the entire overview and structure of Forms....

That said, here are some quick suggestions...
> 1. In my application , I write the following code in
> WHEN-NEW-FORM-INSTANCE :
> enter-query ;

You probably want EXECUTE-QUERY;
If you wish to control the parameters of the query when calling the form, then this is entirely different and you will need a combination of COPY TO function and the Pre-Query Trigger along with the Execute-Query statement.

> 2. In my application , when I open my form and then close
> the form with the icon:X on the top-right of the form
> The form is not closed .

this is normal for the MDI in Forms. Either: click on the main outer window 'X' and the inner window will close, or you must add a When-Window-Closed trigger to the module and also make sure the Window property CLOSE is set to YES.

>
> 3. My form is a master-detail relation form , when I query
> a master record , then the detail records successfully
> fetched out , Then I put the cursor on the detail record
> and delete that detail record , But , system said " Can not
> Delete master record with details " , After this message,
> I try again to delete the detail record , then succeed ,
> WHy ??

  1. Could you have pressed delete on a master record and then not COMMITed, then tried to delete a detail and seen this error?
  2. Are you certain your relationship (master-child) link is in the proper direction?

> 4. How can I implement a seq-no item before each detail
> record on the screen , the seq-no is only display on
> the screen , not store in database . when user add a
> new record , or del a record , the seq-no can automatically
> renumber .
> For example :
>
> 1 record-001
> 2 record-002
> 3 record-003

I would ask, why is this feature necessary for your application? I believe this is not so simple to do in Forms, and it might not be worth lots of custom coding to achieve this effect... ??? (Anybody else have an answer for this one?)

> 5. I have a total-amount item (non-base table item )
> in the screen , when user add some detail records to
> screen (before commit to database) , how I can refresh
> the total-amount item automatically .

I believe you can place a When-Validate-Item on the numeric item in the detail and when the user exits the field, the trigger can update the total. You can also explore the Post-Change item trigger.

>
> 6. I put a select statement on the item's WHEN-VALIDATE-ITEM ,
> after the validation , all of the following item's WHEN-VALIDATE-ITEM
> are triggered , that is not as what I supposed , I can not
> find the root cause .

??? I don't know. It sounds like you placed the When-Validate-Item on the item in a block which displays multiple records, and now it executes for every row displayed when maybe you wanted it to execute just once????

You could place the validation in a Post-Query record along with a :Global.Flag type variable to test for first time and execute the select only once... ???

> 7. Can anyone let know how to debug the program , since I use
> the Form's Help-Debug , there is no use .

My personal opinion is that the debugger is helpful only half the time...when I want to step slowly through the code or look at contents of variables... The Debug Messages can be helpful in locating which trigger is firing when the error occurs. But I also prefer to put message statements, or an ALERT to put messages on the screen, or put INSERT statements into a temp table (old fashioned brute force method), because sometimes the debugger is just not friendly enough, unlike other programming language debuggers...

Good Luck
Robert Proffitt
Beckman Coulter
Brea, California
RTProffitt_at_beckman.com

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Apr 24 2000 - 00:00:00 CEST

Original text of this message