Jump to content

creating a related record doesn't do lookups...why


garrett
 Share

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

Recommended Posts

I am at a loss with this one! Please help!

I have a solution that has File1 and File2. File1 has a portal in it to create records in File2 via relationship. When I run a script to insert the date into a field in the portal (thus creating a new related record in File2 with an ID number as the matching field), for some reason, my lookups in File2 don't happen. And worst of all, it is intermittent. If it doesn't lookup data the first time, I delete that record from File2 (deleting it from the portal in File1 or directly in File2) then run the same script again, and it's fine - lookups occur in several fields.

The lookups are quite simple - just getting data from File1 and plugging it into File2's fields.

What's going on here??

My script does this:

Go to Portal Row [Last]

Set Field[File2::DateStarted; Get (Current Date)]

Commit Records/Requests [skip data entry validation; No Dialog]

Any ideas? Thanks so much!!!

confused.gif

FileMaker Version: 7

Platform: Mac OS X Jaguar

Link to comment
Share on other sites

Is it possible that when a new record is created, the "auto-entered" PersonID number is not yet "committed" and therefore when a related record is attempted to be created by my script, it has no ID number yet, and therefore the relationship won't work to perform the needed Lookups???

But then why am I even able to create a related record via the portal in the first place?

I am going to try to add the following first line to my script to see if it fixes it:

Commit Records/Requests [skip data entry validation; No Dialog]

Go to Portal Row [Last]

Set Field[File2::DateStarted; Get (Current Date)]

Commit Records/Requests [skip data entry validation; No Dialog]

I've added one more Commit Records step to see if by committing the File1's record, it should not log the ID number needed for the relationship.

What do you all think?

Link to comment
Share on other sites

Well, I fixed it. Adding the Commit Record step as the first step of the script fixed the problem. When someone is using the database, they enter data into a bunch of fields then click this button. This method worked just fine with Version 6 of FMP. Odd that it changed with version 7.

Lesson learned, I guess. But I still find it strange that I can make a related record via a portal if the ID is not "committed".

FileMaker Version: 7

Platform: Mac OS X Jaguar

Link to comment
Share on other sites

This topic is 6486 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
 Share

×
×
  • Create New...

Important Information

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