Jump to content

Set Field Scripting Question that's driving me crazy


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

Recommended Posts

Posted

I'm very new to Filemaker, but up until now I have found the program quite intuitive. Here's my dilemma:

I am trying to automate the process of adding contact info for artists when we create a new event (concert)

There are two layouts involved the "events" layout which has details of the event including the artists, the time, the date, the program, tickets sold..etc.

There is also an Artists Layout which gives the details of the artist:Contact Info, Myspace Page, Photos, etc.

Here's what I'm trying to do. When an artist name is entered in the "headliner" field on the events layout, if the user clicks a button it will activate a script that creates a new record in the "artists" layout and the "group name" in that layout will have the text from the "headliner" field in it. Here's the script that I thought would work:

Go to Layout ["Artists" (Artists")]

New Record/Request

Set Field [Artists::Group Name; Events::Headliner]

When I run the script I get a New Record, but it's empty, "Group Name" doesn't show up...

It's driving me crazy. Is there a relationship that has to be set up first, for this to work. I can make it work with copy and past, but I don't want to use those functions.

Any insight would be much appreciated!

Posted

You need to capture the "Headliner" data before you create the new artist record if there is no relation between the tables:

Set variable $headline with artist name

Go to Layout ["Artists" (Artists")]

New Record/Request

Set Field [Artists::Group Name; $headline]

  • 4 weeks later...
Posted

Although this works, it is very poor design because it relates tables using text values rather than unique numerical keys.

Each Artist in the Artist table should have a unique numerical ID (an auto-enter number field, Artist_ID).

An Event would have in its Headliner field, an Artist ID. I suppose each event has only one Headliner, but can have more than one Artist. Therefore, you need a table that stores the join between Events and Artists. In this table, you could mark a record as the Headliner.

How are you determining if it's a new Artist to your system when you specify them as the Headliner? It seems that there's no check.

Posted

What you are saying makes sense. What I had done is set an autofill from the "artists" layout in the headliner field. I also have a script that when someone types a new artists name in the headliner field, an new window opens with the "artists" layout allowing the details of the artist to be entered.

If someone doesn't spell the artists name correctly or leaves out a "the" there will be duplication, but I think that could happen even if I created a unique ID.

Posted

I typically have a user Find before they are allowed to create a New Record. Duplicates will still happen, but they're reduced.

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