Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted (edited)

Hello. 

I have two tables: Person and Recruiting

Within Person, I have a field Person::Source (which indicates the recruiting event we first met the person)

Withing Recruiting, a record is created for each recruiting event. 

I have the Person::Source field set to run the following script each time I enter a new Person record, which then creates a new Recruiting record

Freeze Window

Set Variable [$Source; Value: Person::Source]

Go to Layout ["RecruitingList" (Recruiting)]

New Record/Request

Set Field [Recruiting::Recruiting Event; $Source]

Go to Layout [original layout]

The problem I am having is that we have several Person records with the same Person::Source value, and each time I run the script is creates duplicate records in Recruiting. Is there anything I can add to the existing script that will prevent the new record from being created if it the record already exists? 

 

 

 

Edited by Lee Smith
Removed the Red Text
Posted

I would start by defining the Recruiting Event field to validate as Unique.

Then make your script:

Freeze Window
Set Variable [$Source; Value: Person::Source]
Go to Layout ["RecruitingList" (Recruiting)]
Set Error Capture [ On ]
New Record/Request
Set Field [Recruiting::Recruiting Event; $Source]
Commit Records/Requests
If [ Get ( LastError ) = 504 ]
  Revert Record/Request [ No dialog ]
End If
Go to Layout [original layout]

 

  • Like 2
  • Newbies
Posted

Hello Comment, 

This worked perfectly! The Unique validation tip also helped me figure out another issue I was having. Thank you very much!

This topic is 3064 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.