AnsweredAssumed Answered

Contingent Primary Key

Question asked by user30733 on Aug 23, 2017
Latest reply on Aug 27, 2017 by jbrown

I am looking to do the following:

 

Client Table has a unique client number (e.g., Apple = 1, Samsung = 2, etc.)

 

After creating a client in the system, I then go to a project screen to create a new project for the client.  Let's say the first 5 projects are from Apple, Apple, Samsung, Apple, Samsung.  I would like my primary keys for the projects to be:

 

A-1

A-2

S-1

A-3

S-2

 

Is this possible?  The two issues are:

 

1) How can I make the ClientID (primary key on client table) to autogenerate A or APP or APL, etc., instead of 1, 2, 3, 4?

 

2) How can I make sure that the primary key for the project considers whether this is the first, second, third...project for each client instead of the first, second, third...entry into the table?  Is there a way for FileMaker to add the next incremental number based on the number of times that the particular ClientID has shown up Projects table?

Outcomes