Saving child rec before Parent record, How? 
Author Message
 Saving child rec before Parent record, How?

I am still very new with Clarion 4 ABC.

I have a update form (parent) containing a Child Listbox using EIP.

When I am adding new parent rec, & I need to add one child rec. I get a
validity error
"itm:AssetCode must be found in Register".

Please How do I go around this validity check only when adding new parent
record.

Thanks

Femi



Sun, 05 Aug 2001 03:00:00 GMT  
 Saving child rec before Parent record, How?
Don't add the child records first. What you would want to do is as
follows:
1) When editing an existing record, read all child record into a queue
2) Instead of browses with EIP on the child files, do it on the queues
holding the child records
3) When the user OKs the parent, run through the child records. Any that
are not in the queue, delete. Any that have changed, update. Any that
don't exist in the database, add.

This way you only make changes when the parent is updated, and you don't
have to worry about child records sitting on disk without parent
records. No it isn't as easy to write as my write up above, and expect
to spend a day or two getting it working right. After that, you will
find it much easier on your database.

HTH!

Quote:

> I am still very new with Clarion 4 ABC.

> I have a update form (parent) containing a Child Listbox using EIP.

> When I am adding new parent rec, & I need to add one child rec. I get a
> validity error
> "itm:AssetCode must be found in Register".

> Please How do I go around this validity check only when adding new parent
> record.

> Thanks

> Femi



Sun, 05 Aug 2001 03:00:00 GMT  
 Saving child rec before Parent record, How?
John,

Thanks for all the help.

I have changed my modus-operandy. I guess I still think like a DOS
programmer.

Well, I am learning. Still have a long way to go.

Thanks

Femi

Quote:

>Don't add the child records first. What you would want to do is as
>follows:
>1) When editing an existing record, read all child record into a queue
>2) Instead of browses with EIP on the child files, do it on the queues
>holding the child records
>3) When the user OKs the parent, run through the child records. Any that
>are not in the queue, delete. Any that have changed, update. Any that
>don't exist in the database, add.

>This way you only make changes when the parent is updated, and you don't
>have to worry about child records sitting on disk without parent
>records. No it isn't as easy to write as my write up above, and expect
>to spend a day or two getting it working right. After that, you will
>find it much easier on your database.

>HTH!



Tue, 07 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copying grand parent, parent, and child records

2. Add Child Record Within New Parent Record form.

3. Adding child records for a newly inserted parent record (CW2003)

4. SQL - adding child record from parent form

5. How To restrict child browse to selected parent browse record

6. Reports with One Parent and Two Child files(multiple records eacy)

7. Copying autonumbered parent, child, grandchild records...

8. Copying Parent, Child, Grandchild Records...

9. Copying Parent, Child, Grandchild autonumbered records...

10. Copying Parent child grandchild records

11. Deleting Parent Record Via Child?

12. Adding child clears parent record

 

 
Powered by phpBB® Forum Software