Updating parent file when child edited 
Author Message
 Updating parent file when child edited

Hi All

We have an invoice header / detail type situation, where the user fills in
the form for the parent (header) file, then selects to add / edit child
(detail) records. Embeds in the form for the child records update the parent
fields according to a number of rules.

On returning from the child form, the parent form should be updated with the
calculations from the child records, but we cannot get this to display,
inspite of having ThisWindow.Reset in the GetFocus embed for the parent
window.

Can anyone help?

TIA
Andy Hill



Fri, 22 Feb 2002 03:00:00 GMT  
 Updating parent file when child edited


Quote:
> Hi All

> We have an invoice header / detail type situation, where the user
fills in
> the form for the parent (header) file, then selects to add / edit
child
> (detail) records. Embeds in the form for the child records update the
parent
> fields according to a number of rules.

> On returning from the child form, the parent form should be updated
with the
> calculations from the child records, but we cannot get this to
display,
> inspite of having ThisWindow.Reset in the GetFocus embed for the
parent
> window.

> Can anyone help?

> TIA
> Andy Hill

I attach an earlier message on this forum below.
Summary : It seems (I haven't investigated it fully) that Topspeed have
designed in a bug on the request of some users.
The situation was, that if you had a record buffer open and changed
some values in that record buffer in another window on the same thread
it remembered the changes. It now forgets them.
This was to correct other reported bugs.
And you thought going up to Clarion5b was a minor step and everything
should work as in the last version!  :-(
File buffers now seem to be PROCEDURE specific (using the templates)
rather than THREAD specific as before.
Rather a big step I think and I would like David Bayliss to explain at
some point why?
(Unless he has and I can't find the message. Anyone else?)

Stephen Fulton.

COPIED MESSAGE STARTS HERE :

It is possible that the problem that you are seeing is related to
changes in the design of Clarion5B that were made to correct the
Recursion errors and bugs reported throughout the previous releases

In several questions from Customers they were indicating programming
situations where they would have a browse screen, open a window with
entry fields placed for the related browse  The response in versions
before C5B would be that whatever changes made in the entry fields
would be available upon return to the browse

In 5B the buffer value upon entry into a new procedure is stored and
then restored upon exit from the Child Procedure  So now the default
behavior is going to
"remember" the original values contained in the fields upon return from
the 2nd window unless you specifically tell it to keep the new
values... In C5B if you -want- a child procedure to change the data
owned by the parent then you nominate this to be the case. In the
instance of the field Entry window you have go to the window.init
method :

Access:YourFileHere.UseFile(UseType:Returns)

the values shoved into the YourFileHere file will then be returned to
the parent procedure, (browse in your case).

Note that for those procedures where the templates know what is going
on (ie forms / browses etc) the UseFile(UseType: information is filled
in automatically.  Since you are calling a Window with the Entry fields
placed to allow the user to make last minute changes prior to printing
the report the implementation of this restoration of the buffer
requires your writing the embed code to accomplish it

I hope this helps  Let me know if you have any questions or you run
into additional problems

(This information was provided by David Bayliss in response to an
earlier question from a customer )

Tommy d

--
Tom Durso
Topspeed Corporation


Quote:

>David,

>Something changed between PE5a & PE5b.  I have placed Button(s) on
>some of my forms to enter exception data in a window.  I enter the
>data into my current masterfile then return to the form, however the
>data that I just keyed in is not there.  I now store the record before
>leaving the window and then re-read the record after returning from
>the window (love spending my time on work arounds).  Hope someone can
>shed a little light on what is happening.

>Bob Naffziger

>>I'm in the middle of converting a file from Clarion 4  to Clarion 5

using
the
Quote:
>>ABC templates in both,  I keep coming across a consistent problem
that I'm
>>gettting tired of working around and was wondering if anyone has had a
similar
>>problem and may know what the fix is.  Here is a typical description

of
the
Quote:
>>problem.  I've got a report that prints one record selected from a
browse
>>table. Three parameters are passed to the report from the browse

table.
Before
Quote:
>>printing the report a window pops up allowing the user to change any

of
the
Quote:
>>parameters before printing the report.  The window uses the same file

as
the
Quote:
>>table and the values from the table populate the entry controls in the
window
>>as expected, however once the window is closed, the data fields that
were
>>changed in the window revert back to their original values.  Why is
this
>>happening?  I've worked around this problem in the past by setting
global
>>values and using these but I'm getting tired of creating global values
>>everytime I want to open a new window?  The same procedure works fine
using
>>Clarion4.  Is this a bug in Clarion5?  If so when is it going to be

fixed?
I'd

Quote:
>>appreciate any insight into this problem.  Thank You

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Fri, 22 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

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

2. CW4 Writing to a parent file from child file's update form

3. Parent/Child/Related File updating

4. Update Parent/Child files

5. Probleme for update parents and children

6. View Parent changes made in Child Update

7. Update parent field from child?

8. Update of Parent Form from Child

9. C4 Losing data on update to a child from parent

10. Update parent value from child form

11. Adding Child Record to a Child file during Update

12. Copying grand parent, parent, and child records

 

 
Powered by phpBB® Forum Software