How Hide Cancel option in HR case form for particular HR services(Only for case created by user)

Kalpana6
Tera Expert

How Hide Cancel option in HR case form for particular HR services(Only for case created by user)

7 REPLIES 7

Jaspal Singh
Mega Patron
Mega Patron

Hi Kalpana,

Follow below steps.

1. Create a property in the sys_properties table as below

JaspalSingh_0-1697225197451.png

 

2. Create Script include as below

JaspalSingh_2-1697225643488.png

 

 

var hideCancelUIAction = Class.create();
hideCancelUIAction.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {

hidecancel: function(servicesis)
{
	var getservices=gs.getProperty('sn_hr_core.hr_services_ui_action');
	if(getservices.indexOf(servicesis)>-1)
	{
		return true;
	}
	else{
		return false;
	}
},

    type: 'hideCancelUIAction'
});

 

3. Update the Cancel button on HR Case table to use Condition 

gs.getUserID()==current.opened_by && new sn_hr_core.hideCancelUIAction().hidecancel(current.hr_service);

 

All, that is needed is the step 1 i.e. property to pass comma separated values for HR Services for which you want to show Cancel UI action.

Hi Jaspal,

 

Thank you

3rd point script where i need to update. did not get it

It is mentioned, you need to Update the 'Cancel' button condition field.

Hi Jaspal,

 

There is already a condition available in condition hence I tried to add our condition with && but there is not enough space to put our condition.

How can i add it