How To restrict child browse to selected parent browse record 
Author Message
 How To restrict child browse to selected parent browse record

Hi everybody,
I am beginning with Clarion5ee and I cannot find something in the doc.
And I am not yet used to the Clarion Environment and thus still worse to the
Programming language ...

My question is:

How to make the browse on the child file know the current parent key
field's value in order to preset and even restrict the "Child browse" on
a particular record in the parent file?

At first, my child file is empty. So, in this state, no records can anyways
be viewed in the child file.
But when "Insert" on the child, shouldn't it automatically initialize the
"foreign key field" to the parent's value (of the corresponding field,
following the relationship)?

C5ee, ABC
====

What I tried:
===
The tables are related with a relathionship, with the "Cascade" option (on
Delete and Update).
The Validity check for the "primary key fields" are set to "Cannot be zero
or blank", and for the "foreign key field", it is set to "Must be in file"
(the parent file).

I tried to fill in the child table with records, entering by hand, correct
values in the foreign key field, to see if it would be seen next run. No.

I tried to use the "Extension" feature for the "Child Browse" table, that
let you enter a "Range limit Field", but this one only gives me the
possibility to set it to ITS OWN primary key (so the child's primary key),
and NOT the foreign key that establishes the relationship with the parent.
(...I set it anyways, thinking it would restrict the child's primary key,
somehow following the relationship with the specified parent file.)

On the child's Browse, I did enter the two related files in "Files" / "File
schematic" / "File browsing list box" as follows:
-> Products - PRO:KeyProductNum            (=> the child)
    -> ProdFamilies                                       (=> the parent)

I did try to insert an "Embed" in the BrowseProducts (the child) procedure:
PRO:ProdFamNum=PFA:ProdFamNum
... but it does not help.
... even added this Embed into the UpdateProduct procedure: no help.
...maybe I set this embed to a wrong place.

As a matter of fact, what I am asking here, DOES work for the Qwktutor
application that is asked to build with the "Getting started with Clarion"
manual. BUT this case is different because the "primary key" in the child
file IS ALSO the "foreign key" related to the parent file.
I guess this must be a very rare case because if you have a table with
several foreign keys (making relationships with different tables), shouldn't
you refer to a particular record by introducing an additional, individual
identification number as a primary key (for other tables to refer)?

I hope this question is not too long for you to read and that it is
"understandable"... and that someone will have an idea of a solution.
IF the answer is precisely explained in one of the Manuals, do not hesitate
to refer to a precise page to save you time.
Many thanks.
Pierre.

(NOTE:
My newsmessage was refused by the server: "tnews.clarion.com", group:
"topspeed.products.c5ee", so I send it to this newsgroup instead.
Outlook Express cannot send your message.  Object 'How To Initialize foreign
key field', Account : 'tsnews.clarion.com', Server : 'tsnews.clarion.com',
Protocol : NNTP, Port : 119, Secured (SSL) : No, Socket error: 10060, Error
number: 0x800CCC0E
)



Fri, 19 Jul 2002 03:00:00 GMT  
 How To restrict child browse to selected parent browse record
Greetings Pierre,

Despite the error, I do see a copy of the message on
topspeed.products.c5ee ... below is Geoff's response from that NG.

Quote:

> Remove the link from the parent to the child file from the file
> schematic for the procedure, and vice versa.  The child file should
> be under its own 'browse' in the schematic.  In the range limit for
> the child browse choose FileRelationship as the limit type.  That's
> all you need.

> --
> Geoff Bomford
> ComForMark Pty Ltd
> SYDNEY   AUSTRALIA



> > On the child's Browse, I did enter the two related files in "Files" /
> "File
> > schematic" / "File browsing list box" as follows:
> > -> Products - PRO:KeyProductNum            (=> the child)
> >     -> ProdFamilies                                       (=> the parent)



<snip>

- Show quoted text -

Quote:
> (NOTE:
> My newsmessage was refused by the server: "tnews.clarion.com", group:
> "topspeed.products.c5ee", so I send it to this newsgroup instead.
> Outlook Express cannot send your message.  Object 'How To Initialize foreign
> key field', Account : 'tsnews.clarion.com', Server : 'tsnews.clarion.com',
> Protocol : NNTP, Port : 119, Secured (SSL) : No, Socket error: 10060, Error
> number: 0x800CCC0E
> )



Fri, 19 Jul 2002 03:00:00 GMT  
 How To restrict child browse to selected parent browse record
Thanks for reporting. Outlook Express displays an error but... it must be
part of its mother tongue...;-))
I tried the proposed solution and answered to the thread in topspeed's
newsgroup.
Many thanks again. Bye.
Pierre.



Quote:
> Greetings Pierre,

> Despite the error, I do see a copy of the message on
> topspeed.products.c5ee ... below is Geoff's response from that NG.


> > Remove the link from the parent to the child file from the file
> > schematic for the procedure, and vice versa.  The child file should
> > be under its own 'browse' in the schematic.  In the range limit for
> > the child browse choose FileRelationship as the limit type.  That's
> > all you need.

> > --
> > Geoff Bomford
> > ComForMark Pty Ltd
> > SYDNEY   AUSTRALIA



> > > On the child's Browse, I did enter the two related files in "Files" /
> > "File
> > > schematic" / "File browsing list box" as follows:
> > > -> Products - PRO:KeyProductNum            (=> the child)
> > >     -> ProdFamilies                                       (=> the
parent)


> <snip>

> > (NOTE:
> > My newsmessage was refused by the server: "tnews.clarion.com", group:
> > "topspeed.products.c5ee", so I send it to this newsgroup instead.
> > Outlook Express cannot send your message.  Object 'How To Initialize
foreign
> > key field', Account : 'tsnews.clarion.com', Server :

'tsnews.clarion.com',

- Show quoted text -

Quote:
> > Protocol : NNTP, Port : 119, Secured (SSL) : No, Socket error: 10060,
Error
> > number: 0x800CCC0E
> > )



Sat, 20 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Parent-child browse scrolling problem

2. A theoretical question on Parent-Child relation and sortorder in browse

3. Parent form cleared when EIP child browse

4. Parent child browse

5. Child browse in parent form

6. I have Update Form (parent file) with Browse List (child file)

7. Parent and Child Browse Relationship Question

8. CW 2.0 B - Parent/Child Browse

9. Parent/Child Browse Behavior in 5.5

10. Putting a child browse into a parent field

11. EIP with Parent and Child Browse

12. Child Browse on Parent Screen

 

 
Powered by phpBB® Forum Software