Conditions for button

What’s the best method of doing this?

I have a button that let’s the user choose 3 options as the kind of document updloading. I want one user to however just be able to upload one type of document. Should I just put in the properties to launch the button with the default field? I don’t want the user the change the type though. I figure I would just keep the form since it has all the fields I want to show up in the view.

What’s the best method of doing this.

Subject: Button options

How can a button be used to choose among options?

Subject: RE: Conditions for button

What you want to do can almost certainly be done by using a formula to create the list of options. However, since your description of what you are doing is very vague, I cannot be more specific than that about how to do it.

Subject: RE: Conditions for button

Sorry…

Ok, here’s the deal. I’ve already created a button where the first field is a dialogue list. I’m told now 2 people need to use the button but they should only be able to choose 1 option in the dialogue list. Basically they can only add 1 type of document or attachment to the database. They should not be able to add to the other two list.

I hope that explains it…

Subject: RE: Conditions for button

No, you provided no additional information. So I will just guess about what you’re asking and answer that. Since you gave no formula or script, I assume by “button” you mean a radio button.

It’s a very bad idea to hardcode people’s names into the database design, because then you have to change the design whenever there’s a personnel change. You need to establish “roles” in the database ACL and assign people or groups to those roles, based on what operations they are allowed to perform in the application.

The choices are “Takeoff”, “Land”, and “Serve Coffee”. Let’s say there is a role named “[Pilot]” that is allowed to select any of the three choices. Another role, named “[FlightAttendant]” are only permitted to select one of the choices, “Serve Coffee”. Other people should not be able to make a selection at all. In the field properties dialog of the radio button, in the second tab, use the pull-down to select “Use formula for choices.” In the box below that, enter the following formula:

_roles := @UserRoles;

@If(_roles = “[Pilot]”; “Takeoff” : “Land” : “Serve Coffee”;

_roles = “[FlightAttendant]”; “Serve Coffee”;

“No choices|”)

Subject: RE: Conditions for button

Ok, it makes more sense now. I will try this out… Thanks!

Subject: RE: Conditions for button

Yes, that works for me. Ok, so what about users that have access to write docs.

They will still be able to save a doc here but it will be not categorized. How do I prevent that?

Subject: RE: Conditions for button

It sounds like you’re saying that there are users who have access to write documents but aren’t in any of the groups you allow to select any of these choices. This presents a problem for you because you don’t want to have the documents they create show up in views as uncategorized.

This is your application and you get to choose how it works. Ideally, how do you want this to work? Do you want to prohibit users who are not members of the roles from creating the documents? Do you want to force everyone who creates a document to enter a value in this field, and if so, what value if the person is not in one of your roles? Or do you want to let people create documents with no selection and accomodate this in the views? Do you want such documents to show up in your categorized view at all? Or do you want them to show up but with a different value than (uncategorized)?