Hide or Disable Button

I’ve modified a Discussion DB to be used as a routing form. I created “approval” buttons that when pressed, adds the person’s name and date to their respective fields. I created roles in order to hide the buttons so only particular departments would see their respective button (e.g. accounting will only see the “accounting approval button”). Unfortunately I haven’t figured out how to either lock the field or button once the button has been pressed. For example, when John Doe presses the button his name and date are stuck into fields using the following formula.

@SetField(“request_sign”;@Name([CN]; @UserName));

@SetField(“request_date”;@Today)

There is another person, John Brown, with the same roll. So if he goes into the document later, he still has the ability to press the button and modify the name and date fields. I’m trying to figure out how to either lock the fields or possibly hide the button after it’s been pressed. I think either would be sufficient. Thanks in advance!

Subject: Hide or Disable Button

your hide formula for the button would be:

@Contains(request_sign; @Name([cn]; @UserName))

You could also add this code to the top of your button. This will stop the code if the current user has already pressed the button

@If(@Contains(request_sign; @Name([cn]; @UserName)); @Return(@Prompt([ok]; “”; "you have already approved this record)); “”);

Subject: RE: Hide or Disable Button

Thank you very much! Worked like a charm.

Subject: Hide or Disable Button

To hide the button you can enter a hide when formula via the button’s properties box. Something like:

@if(request_sign != “”;@true;@false)

Or even:

request_sign != “”

You can also incorporate the @if into the button code that sets the field value:

@if(request_sign = “”;@setfield(“request_sign”;@name([cn];@username);“”)

Hope this helps…