Hide Button (link url filed) on form after click

  • 0
  • 1
  • Question
  • Updated 5 months ago
  • Answered
I have a Button on a form (link Url Field) that is used for Approval.  It then populates another field  that is Text Multiple Choice called Approvals with ex:  "[JUN-07-18 IT Support] Approved "  and fires off some email notifications etc.  

I would like this button to not show or be grayed out after it has been clicked once. Were having users repeatedly clicking Approve Button and not knowing they have already approved (not sure why they don't check the status first) so this creates duplicate notifications and confusion.  Any help would be appreciated or if this has been resolved in another post if you could point me there.

this is the formula on the Button URL Field which works well

URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=5t39dmb9j59pjdz6mj9hd55p9rd&_fid_48=Approved&rid=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?act=dr&rid=" & [Record ID#])
Photo of IT Support

IT Support

  • 190 Points 100 badge 2x thumb

Posted 5 months ago

  • 0
  • 1
Photo of JimLieder

JimLieder

  • 344 Points 250 badge 2x thumb
You can use a dynamic form rule to hide the button when the status is Approved.

Example:  When Status is equal to Approved hide the Approval Button.

Or you can wrap your code in a IF statement to hide the button on the form when the Status is Approved.

If([Status]="Approved"," ",
URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=5t39dmb9j59pjdz6mj9hd55p9rd&_fid_48=Approved&rid=" & [Record ID#] & "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?act=dr&rid=" & [Record ID#])
)
Photo of IT Support

IT Support

  • 190 Points 100 badge 2x thumb
Bah that was too easy!!  Just added form rule and took care of it.  Really appreciate the response.  Was over thinking it I guess ;-) 
Photo of Gil Spigelman

Gil Spigelman

  • 870 Points 500 badge 2x thumb
I would use Jim's second option of using an If statement. We do the same because you only make the update once. If you start placing the button on multiple forms, you have to update the form rules on each one.