Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

Deleting records

i have duplicated a record in my database. when i delete one of the duplicated record in the file, i realise that the other record is deleted too. the script command that i assigned is only delete a record ( Not delete all record ). How could i prevent this from happenning
ps:- This file get its record from another file through a relationship.
0
treynathan
Asked:
treynathan
  • 2
  • 2
1 Solution
 
weedCommented:
When you have relationships set up its just like having the other database IN your current database. Changes to one, affect the other. There is only one record, the one in the related database. When you delete it, its gone.
0
 
treynathanAuthor Commented:
i realize that.. but then again.. when you create a relationship, you do have an option whether to have the related record in the other database to be deleted together when you delete a record in the current database. I didn't go for that option. and so i assume that if i delete in this database, no record will be deleted in the related file. the problem is.. i duplicated a record in the current database, when i delete record 1, record 2 also get deleted (see example). This is what i don't understand!
example record 1:  database 1       database 2
                             customer          service
             record 2:  customer          service ( duplicated version of record 1)
0
 
weedCommented:
Deleting a record in the current database, and deleting a related field in the current database are different beasts. If the field is from another database itll get deleted in the only one it exists in.
0
 
Mariano_PetersonCommented:
Can you please be a bit more descriptive in your description of the problem?  It's somewhat difficult to understand what you are describing.

When you write that deleting record 1 also deletes records 2, do you mean that:
record 1 and record 2 are deleted from database 1, or
record 1 and record 2 are deleted from database 2, or
record 1 and record 2 are deleted from both database 1 and database 2?

In your example above, there are actually 4 records:

database1 -> record1
database1 -> record2

database2 -> record1
database2 -> record2

How are you deleting the records?  Are you deleting them via a script, or are you deleting them directly by going to Records > Delete Record or clicking "ctrl+E"?

How many relationships are in your database?  Do you have any self relationships?  Do any of your other relationships specify to delete related records?  I have a feeling that you may have multiple relationships, one of which deletes related records.  Perhaps you are only examing the first relationship (which might not specify to delete related records), but the second or third relationship might be set to delete related records (and might alsoo be based on different key fields).
0
 
treynathanAuthor Commented:
hey... thanks... i manage to set right things. you were right abt the multiple relationship. I didn't realise that i set the seft relationships to delete the related records. As you are aware.. i'm still very new to filemaker (only two months) Thanks again for answering my questions with patience.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now