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 6327 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Does FMP allow for a degree of participation? For instance, if I have a db with Agents table and Clients table (w/appropriate keys), how can I limit the agents to no more than four clients. In ERD this is often written as (1,4).*

*(Witht the presumption that an agent must have at least one client. Could also be written as (0,4) if the agent need not have any clients, etc.

Thanks.

dan

Posted

If you run your solution as client/server either with a Filemaker Server or with a filemaker client as a host, you can create a startup script, which check for current user count. ( Get(CurrentUserCount) )

With this, you can quit the client number 5 (or whatever number)

Posted

There is nothing in FMP that specifically enforces this constraint. You can get close through the validation mechanism using the calculation option.

To enforce the maximum create a self-relationship for the "Client" table using the foreign key for the "Agent" as the self-join key. This will link a client to all other clients of a particular agent. Then create a validation by calculation that counts the number of related records. Example:

"Count ( relatedClients::agentID ) <= 4"

For the minimum constraint you can place a validation calculation on a field in the "Agent" table to ensure there is at least one client. Example:

"Count ( Clients::agentID ) >= 1"

You may need to implement additional constraints within the privilege sets to avoid users getting around the constraint (for example getting around the minimum by creating a dummy client and then deleting it). You will also need to ensure your record creation process allows users to satisfy the constraints, otherwise they will get warning and error dialogs about which they can do little or nothing.

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