Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Relationship error when creating a new record


This topic is 8017 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi everybody this is my first post so take it easy on the newb.

I have a problem with creating new records through a portal.

I have 4 database files: Clients, Therapists, Service, Service Logs

The error I get is "The relationship "Service" is not valid and must be corrected before this field can be modified"

The service database holds each service that is done with a client. The Service Log database shows the client and therapist with each service related to them in a portal.

I'm able to see the related service records when I select a client and therapist. But when I try to add a new record through the portal I get that error "The relationship "Service" is not valid and must be corrected before this field can be modified"

Hope thats enought information for you guru's.

Thanks for any help.

V

Posted

Ok, so have you checked the relationship's definition?

  • Newbies
Posted

Thanks for the reply!

Yes the portal and the fields in the portal use the same relationship that I defined.

the relationship uses a caluclation of client ID and therapist ID. The calculation is the exact same in both the service database and the service log database. I double checked that as well.

The thing is that it shows the related records that are already in the service database just fine. but its when I try to add new ones to the service database through the portal in the service log database that I get that problem.

Thanks again for the help. Its greatly appreciated

  • Newbies
Posted

Yes I have double checked the relationships definition and that the fields and the portal are using the same relationship definition.

thanks for all the help.

V

Posted

Your right key is calculated.

The allow creation of related records can not work when the right key is calculated.

Instead, use the primary relationship (ID-->ID) for creating related records or use external script for creating child record or redefine your actual relationship to have only left key calculated and leave "allow creation of related records " on

Dj

Posted

Hi GrandMasterV,

Your problem arises from the fact that you have a calculating field as the key field on the right side of your relationship.

In order to create a new record via the relationship, FileMaker has to be able to write the correct key value for the current record in the main file to the corresponding key field in the related file (to establish the link).

Since calculating fields cannot be written/modified, relationships which use them as the related file key are not able to create new records via the relationship.

A couple of solutions are:

1. create the new records via a script which transfers the values on which the key field in the related file depends to global fields in the related file and then calls a subscript in the related file to create a new record and copy the values from the global fields to the appropriate destination fields in the new record (thus establishing the link back to the main file via the calculated key.

or

2. Reverse the direction of calculation in your related file. Set the key field as a data entry (text) field, and re-define the component fields as calculations with formulae which parse the component values from the concatenated text in the key field. That way you'll be able to create new records via the relationship, but will still have access to the separate values for use in the related file.

This topic is 8017 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.