Daniel Shanahan Posted September 23, 2007 Posted September 23, 2007 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
Claus Lavendt Posted September 24, 2007 Posted September 24, 2007 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)
corn Posted September 24, 2007 Posted September 24, 2007 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.
Daniel Shanahan Posted September 25, 2007 Author Posted September 25, 2007 Thanks for the work around solutions. -dan
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now