Cannot add a record because the foreign key value not exist in master table

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

Cannot add a record because the foreign key value not exist in master table

Post by Martinus »

I've got a problem.
I've got two tables: master table (animators) and detail table (projects). UserID from the master table is passed on to the detail table, so the records created by a user are selected and showed. It all works, view, list, edit options work, but when a given user wants to add a new record, somehow the UserID is not passed on to the add form. With the referential integrity option ON, I can't add another record, I get the error : You cannot add or update a record because the foreign key value does not exist in the master table 'animators'. It does not exist, the form field is empty because it is not passed on to the form... why? No idea. Can anybody help?


mobhar
User
Posts: 11660

Post by mobhar »

Perhaps you have already selected another master record that does not related to the previous master record. You may try to logout and login again, and see whether this would help.


arbei
User
Posts: 9286

Post by arbei »

You may review your settings for Referential Integrity.


ach8
User
Posts: 174

Post by ach8 »

I have used the 'Referential Integrity' setting. But I have the problem that key-value does not exist after doing a lookup in the details table. How do I lock the 'Foreign Key' from disappearing after doing a search in the details table so that it is not empty value?


Post Reply