Change Request UI buttons

anusarma
Kilo Expert

Hi All,

I have a requirement to hide certain OOB UI buttons from the change request form.

As per our design, the change request type is empty (shown as "--None--") when new form is loaded. Based on the details filled in, the type is determined only after it is saved. Based on the type, the workflow proceeds as usual. The issue with UI buttons is that all the active UI buttons are visible on the new form itself (i.e., before type is determined). I need to hide the UI buttons at this stage. Once type is determined, then the buttons are visible as per OOB design itself.

I tried adding conditions based on the type field to the existing UI actions script, however, it is not working. Please provide your inputs to fix this one.

Thanks in advance,

Anu

10 REPLIES 10

anusarma
Kilo Expert

Hi Anjali and Priyadarshini,



Thanks for your quick response. Actually, sorry that i didn't make the scenario clear. When the new form is loaded, it has only submit button visible. We fill certain details here. Once it is saved, then in the next page, we need to fill a few more details and here also "type" is "undetermined". At this stage, all the active UI buttons are visible. Once the form is saved at this stage, only then the type is determined.



I need to hide the UI buttons at the stage after the CR is saved just once, where all the active buttons are visible.



The "show insert" field is unchecked only.



Thanks again.


Hi Anna,



Just add in the condition of the ui actions you want hide to,



current.type!='undetermined'





Thanks,


Priyadarshini




PS: Hit like, Helpful or Correct depending on the impact of the response


JSUtil.notNil(current.type);


This will handle everything


-Anurag

anusarma
Kilo Expert

Thanks for your inputs everyone. However, those didn't seem to work in the required manner. For eg., if i use the condition current.type!='' alone in the condition field, then the all the buttons are visible for the type not empty condition from the stage when type is determined itself.



When I use it along with the OOB condition, say for eg., gs.hasRole('itil') && new ChangeRequestStateHandler(current).isNext("implement") && current.type!='', it doesn't make any impact.



Since these UI actions are controlled by the OOB script include, I think there has to be something done. Also, in the UI action, we have the following OOB thing:


if (typeof window == 'undefined')


    setRedirect();




function setRedirect() {


  current.update();


      action.setRedirectURL(current);


}



Is it here I need to modify so that the requirement is met?


Hi Anu,



This script runs in the server side if there is a problem in form loading or error faced in the page.


Its not required to update in this script to fix your issue.





Thanks,


Priyadarshini




PS: Hit like, Helpful or Correct depending on the impact of the response