Cascade Explained

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
starquest321
User
Posts: 140

Cascade Explained

Post by starquest321 »

I have the following situation:

  1. I insert a detail records based on the master table lead index.

So master.lead ----> detail.lead

Now when I update master.email and master.phone I want to populate the results in the detail. I added the two fields in detail field. When I create the record the email and phone are empty. How do I cascade update the phone|email once they are updated?


starquest321
User
Posts: 140

Post by starquest321 »

You cannot add or update a record because the foreign key value does not exist in the master table 'lead'

I have done that - I get this error when I try to update a record.


mobhar
User
Posts: 11905

Post by mobhar »

According to the Help file: "Cascade Update --> Specifies that if the primary key for a record in the master table changes, all corresponding records in the detail table will be updated.", then make sure you update the record in the master table, so that the corresponding records in the detail table will be updated, too.


Webmaster
User
Posts: 9438

Post by Webmaster »

Do not enable "Referential Integrity" if you allow orphaned detail records.


Post Reply