AnsweredAssumed Answered

Check availability before saving?

Question asked by Timbalord on Dec 21, 2015
Latest reply on Dec 21, 2015 by mikebeargie

Hello together,

 

im really new to filemaker but i have some experience with SQL. Filemaker seems to use different solutions to SQL. For that, here is my Problem:

 

I have 4 tables

 

Employees

——————

employee_id

name

adress

and so on

 

 

Projects

———

project_id

name

 

 

EmPros (jointable Employees and Projects)

————

empro_id

employee_id

project_id

empid_projid (a formal based combination of the employee_id and the project_id to make this combination unique)

status (active or inactive)

 

Projectstatistics

—————

empro_id

date

earnedMoney

hours

and so on

 

And here is my Problem:

If the employee has to left the project, i dont want to delete this in the EmPros table, because of he can enter the project after a few days again and because of the Projectstatistic. So i made the field status in the EmPros table and set this to inactive per script. That works fine.

 

But when i set the same Employee again to the project i get the message, that the employee is still with the combination in the tabel (that is correct, because i made the combination as a unique field). I have to be able, to check if the combination is in the table and when its in the table turn status from inactive to active.

 

I dont find a solution, that let me do a query like this in a script.

Outcomes