dbTalk Databases Forums  

Deleting related records FM10

comp.databases.filemaker comp.databases.filemaker


Discuss Deleting related records FM10 in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John G.
 
Posts: n/a

Default Deleting related records FM10 - 09-14-2009 , 01:47 AM






Although I have privately used FM for many years it has only been simple
unrelated files.
If I have a Customer table related to an invoice table :-
What is the correct process to delete a single line item from the invoice
table without deleting the customer as well from the customer table.

John G.

Reply With Quote
  #2  
Old   
Ursus
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-14-2009 , 03:41 AM






No straightforward answer. all depending on your setup. But the simplest
would be if you had a portal in customer showing all related invoices. Then
it would require a script with only one step (Delete Current Portalrow) and
a button on the first portal row firing the script. Ofcourse this deletes
the related record without any confirmation, you have to add this to the
script if you want.

--
Keep well / Hou je goed

Ursus

"John G." <greentest (AT) ozemail (DOT) com.au> schreef in bericht
news:4aade71d$0$27597$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au...
Quote:
Although I have privately used FM for many years it has only been simple
unrelated files.
If I have a Customer table related to an invoice table :-
What is the correct process to delete a single line item from the invoice
table without deleting the customer as well from the customer table.

John G.

Reply With Quote
  #3  
Old   
John G.
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-14-2009 , 04:27 AM



Thanks for the help.
I am sure I can develop something from that clue.
But I would have thought there should be a way to delete a "record" from the
detail table when looking at a list view of just the details without
deleting the master part.
This is mostly a learning experience on my part as the application is just
for me and the world won't end if I don't get it right.
Thanks agian for your help.

John G.

"Ursus" <ursus.kirk (AT) ziggo (DOT) nl> wrote

Quote:
No straightforward answer. all depending on your setup. But the simplest
would be if you had a portal in customer showing all related invoices.
Then it would require a script with only one step (Delete Current
Portalrow) and a button on the first portal row firing the script.
Ofcourse this deletes the related record without any confirmation, you
have to add this to the script if you want.

--
Keep well / Hou je goed

Ursus

"John G." <greentest (AT) ozemail (DOT) com.au> schreef in bericht
news:4aade71d$0$27597$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au...
Although I have privately used FM for many years it has only been simple
unrelated files.
If I have a Customer table related to an invoice table :-
What is the correct process to delete a single line item from the invoice
table without deleting the customer as well from the customer table.

John G.



Reply With Quote
  #4  
Old   
Bill
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-14-2009 , 07:50 AM



In article
<4aae0c94$0$27619$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au>,
"John G." <greentest (AT) ozemail (DOT) com.au> wrote:

Quote:
Thanks for the help.
I am sure I can develop something from that clue.
But I would have thought there should be a way to delete a "record" from the
detail table when looking at a list view of just the details without
deleting the master part.
This is mostly a learning experience on my part as the application is just
for me and the world won't end if I don't get it right.
Thanks agian for your help.

John G.

"Ursus" <ursus.kirk (AT) ziggo (DOT) nl> wrote in message
news:237b5$4aae01cd$53578889$10719 (AT) cache4 (DOT) tilbu1.nb.home.nl...
No straightforward answer. all depending on your setup. But the simplest
would be if you had a portal in customer showing all related invoices.
Then it would require a script with only one step (Delete Current
Portalrow) and a button on the first portal row firing the script.
Ofcourse this deletes the related record without any confirmation, you
have to add this to the script if you want.

--
Keep well / Hou je goed

Ursus

"John G." <greentest (AT) ozemail (DOT) com.au> schreef in bericht
news:4aade71d$0$27597$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au...
Although I have privately used FM for many years it has only been simple
unrelated files.
If I have a Customer table related to an invoice table :-
What is the correct process to delete a single line item from the invoice
table without deleting the customer as well from the customer table.

John G.



To add a little:

Relationships can be set up with various options. If you have the option
on one side checked "Delete related record in this table when a record
is deleted in the other table" then the deletion of the related
record(s) will occur as indicated. If that box is not checked, the
related record will not be deleted.

Reply With Quote
  #5  
Old   
Lynn Allen
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-14-2009 , 10:41 AM



On 2009-09-14 02:27:49 -0700, "John G." <greentest (AT) ozemail (DOT) com.au> said:

Quote:
I am sure I can develop something from that clue.
But I would have thought there should be a way to delete a "record" from the
detail table when looking at a list view of just the details without
deleting the master part.
This is mostly a learning experience on my part as the application is just
for me and the world won't end if I don't get it right.
Take a look at the relationship between the table occurences. If you
have "Delete related record in this table when a record is deleted in
the other table" set on, in either direction, there will be effects.

If it's set for the child table, and you delete the parent, you'll lose
all the child records on deleting the parent. If it's set on the parent
table, you'll lose the parent every time you delete a single child. If
you've lost the parent record after deleting a child record from a list
view, I suspect this is what you've got.

Normally, deletion permission should only be set on child tables. Many
developers script their child record deletion so that it doesn't fire
when they don't want it to.

Setting deletion in both directions on a relationship will set up a
circular thing I have no idea what will happen. Could be very bad.
Also, make very sure that if you have a constant relationship (using a
calc of 1 in either or both tables) and you set deletion on, you'll
lose the entire table of data if you delete one record in the other.
This also works for Cartesian relationships.

Cascading deletes, where a parent, child, grandchild and so on, string
of tables all have deletes turned on, can be very very slooooow. Not
recommended.

Luckily, the deletion option is set off by default, so you have to very
deliberately choose the directionality of your deletion, if any.

Lynn Allen
FM 10 Certified Developer
Long Beach, CA

Reply With Quote
  #6  
Old   
John G.
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-15-2009 , 05:48 AM



"Lynn Allen" <lynn (AT) semiotics (DOT) com> wrote

Quote:
On 2009-09-14 02:27:49 -0700, "John G." <greentest (AT) ozemail (DOT) com.au> said:

I am sure I can develop something from that clue.
But I would have thought there should be a way to delete a "record" from
the
detail table when looking at a list view of just the details without
deleting the master part.
This is mostly a learning experience on my part as the application is
just
for me and the world won't end if I don't get it right.

Take a look at the relationship between the table occurences. If you have
"Delete related record in this table when a record is deleted in the other
table" set on, in either direction, there will be effects.

If it's set for the child table, and you delete the parent, you'll lose
all the child records on deleting the parent. If it's set on the parent
table, you'll lose the parent every time you delete a single child. If
you've lost the parent record after deleting a child record from a list
view, I suspect this is what you've got.

Normally, deletion permission should only be set on child tables. Many
developers script their child record deletion so that it doesn't fire when
they don't want it to.

Setting deletion in both directions on a relationship will set up a
circular thing I have no idea what will happen. Could be very bad. Also,
make very sure that if you have a constant relationship (using a calc of 1
in either or both tables) and you set deletion on, you'll lose the entire
table of data if you delete one record in the other. This also works for
Cartesian relationships.

Cascading deletes, where a parent, child, grandchild and so on, string of
tables all have deletes turned on, can be very very slooooow. Not
recommended.

Luckily, the deletion option is set off by default, so you have to very
deliberately choose the directionality of your deletion, if any.

Lynn Allen
FM 10 Certified Developer
Long Beach, CA
Thanks to you all I think I have a better understanding now and can do what
I wanted to do.
How did we solve little understanding difficulties before we had News groups
and the rest of the internet to ask others these questions?

John G.

Reply With Quote
  #7  
Old   
Lynn Allen
 
Posts: n/a

Default Re: Deleting related records FM10X-TraceApproved - 09-15-2009 , 10:58 AM



On 2009-09-15 03:48:33 -0700, "John G." <greentest (AT) ozemail (DOT) com.au> said:

Quote:
Thanks to you all I think I have a better understanding now and can do what
I wanted to do.
How did we solve little understanding difficulties before we had News groups
and the rest of the internet to ask others these questions?
Painful experience. Extremely painful.
--
Lynn Allen
--
www.semiotics.com
Member FBA
FM 10 Certified Developer

Reply With Quote
  #8  
Old   
Your Name
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-15-2009 , 03:53 PM



"John G." <greentest (AT) ozemail (DOT) com.au> wrote

Quote:
Thanks to you all I think I have a better understanding now and can do
what
I wanted to do.
How did we solve little understanding difficulties before we had News
groups
and the rest of the internet to ask others these questions?
By reading the manual that used to be included with software (and hardware),
but rarely is these days. The software "Help" is useful, but not very
comprehensive. (

Helpful Harry )

Reply With Quote
  #9  
Old   
John G.
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-15-2009 , 06:19 PM



"Your Name" <your.name (AT) isp (DOT) com> wrote

Quote:
"John G." <greentest (AT) ozemail (DOT) com.au> wrote in message
news:4aaf7100$0$27611$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au...

Thanks to you all I think I have a better understanding now and can do
what
I wanted to do.
How did we solve little understanding difficulties before we had News
groups
and the rest of the internet to ask others these questions?

By reading the manual that used to be included with software (and
hardware),
but rarely is these days. The software "Help" is useful, but not very
comprehensive. (

Helpful Harry )

In my days (long ago) of teaching in company training schools I was renowned
for saying "RTFM" but sometimes little details still escape one just reading
the Help, so a few clues from this group, who always seem very ready to
help, just filled in a little gap that may have taken ages to realize on my
own.
Thanks again to those who answered, and keep up the good work.

PS this seems to be one of the better NGs, free from politics and personal
attacks.

John G.

Reply With Quote
  #10  
Old   
John G.
 
Posts: n/a

Default Re: Deleting related records FM10 - 09-21-2009 , 04:37 AM



"John G." <greentest (AT) ozemail (DOT) com.au> wrote

Quote:
"Your Name" <your.name (AT) isp (DOT) com> wrote in message
news:h8oums$nd7$1 (AT) lust (DOT) ihug.co.nz...

"John G." <greentest (AT) ozemail (DOT) com.au> wrote in message
news:4aaf7100$0$27611$5a62ac22 (AT) per-qv1-newsreader-01 (DOT) iinet.net.au...

Thanks to you all I think I have a better understanding now and can do
what
I wanted to do.
How did we solve little understanding difficulties before we had News
groups
and the rest of the internet to ask others these questions?

By reading the manual that used to be included with software (and
hardware),
but rarely is these days. The software "Help" is useful, but not very
comprehensive. (

Helpful Harry )

In my days (long ago) of teaching in company training schools I was
renowned for saying "RTFM" but sometimes little details still escape one
just reading the Help, so a few clues from this group, who always seem
very ready to help, just filled in a little gap that may have taken ages
to realize on my own.
Thanks again to those who answered, and keep up the good work.

PS this seems to be one of the better NGs, free from politics and personal
attacks.

John G.
Reading the manual may not have helped much.
I started from a template provided with Filemaker and it had the Delete
options set on unlike the default but alls well now in that regard

John G.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.