Forum Post: RE: Rollbase - Edit/Delete button permission by state

  • Thread starter Thread starter Godfrey Sorita
  • Start date Start date
Status
Not open for further replies.
G

Godfrey Sorita

Guest
You can also accomplish this using JavaScript. Paste the code below to a script component on your view page. script type="text/javascript" $(function() { checkStatus(); }); function checkStatus() { var currentStatus = "{!status#code}"; //Current status of the record var statusToDisableButtons = "^forApproval"; //Change "^forApproval" to your desired status integration code if (currentStatus == statusToDisableButtons) enableButton(' Edit ', false); else enableButton(' Edit ', true); } function enableButton (buttonName, isEnabled) { if (isEnabled) $("[value='"+ buttonName +"'").removeAttr("disabled"); else $("[value='"+ buttonName +"'").attr("disabled", "disabled"); } /script For this code to work, make sure to assign integration codes to your statuses and change the value of statusToDisableButtons variable.

Continue reading...
 
Status
Not open for further replies.
Back
Top