Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Cancel Request button

Highlighted
cat_gon0208
Super Collector

Hide Cancel Request button

Hi All,

 

Is there a way I can hide the out of the box Cancel Request button at a certain status?

 

Thanks.

 

Cat

3 REPLIES
jerome.vovard
Regular Collector

Re: Hide Cancel Request button

HI,

You can use a customized UI rule.

Here is a ui rule to hide an action button. just modify it to hide cancel button:

function hideWFButton(buttonLabel, flag) {
 //Check if user have the rights to perform workflow action
 if(null != document.getElementById("DIV_EC_REQUEST_WF_AVAILABLE_ACTIONS")) {
 
  var wf_buttons;
  var links;
  var newDisplay;
  
  wf_buttons = document.getElementById("DIV_EC_REQUEST_WF_AVAILABLE_ACTIONS");
  links = wf_buttons.getElementsByTagName("a");
  
  //determin the new style
  if(flag) {
   //hidden
   newDisplay = "none";
  } else {
   //display
   newDisplay = "table-cell";
  }
  
  //go through all buttons
  for(var i = 0; i<links.length; i++) {
   //if button matches with given name, aply the new style to the button
   if(links[i].firstChild.nodeValue == buttonLabel) {
    links[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = newDisplay;
    break;
   }
  }
 } 
}

Utkarsh_Mishra
Honored Contributor

Re: Hide Cancel Request button

Modify package KCRT_PARTICIPANT_CHECK

 

and update function can_user_cancel_request

 

In fucntion can_user_cancel_request just append your Request condition (where clause)

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
d4y4n4
Frequent Visitor

Re: Hide Cancel Request button

Hi Cat,

There is an Er for this QCCR1L35134: Customer wants ability to hide cancel and delete requests with out loosing the abilith to submit requests.

Hope the next release will include this.

Regards,
Dayana Campos
//Add this to "OnDomLoad" event