Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Restrict Actions on the Allocation Workbench (Confirm - Allocate)

Lylys
Giga Contributor

Hello,

I have a question about the restriction on the Actions in the Allocation Workbench.

I customize the UI Action Confirm and Allocate 

I change the condition.

How I put the same condition on the allocation Workbench?

 

 

 

 

Thanks a lot.

 

 

1 ACCEPTED SOLUTION

Harsha Lanka
ServiceNow Employee
ServiceNow Employee

In your code, current is 'not defined'.

Try in below way.

var RMActionValidator = Class.create();
RMActionValidator.prototype = Object.extendsObject( RMActionValidatorSNC,{
    initialize: function(gr) {
                this.currentResPlanGr = gr;
		RMActionValidatorSNC.prototype.initialize.call(this, gr);
    },

    canConfirm: function() {
       if((gs.getUserID()==this.currentResPlanGr.user_resource.manager)||(gs.getUserID()==this.currentResPlanGr.group_resource.manager)){
			return true; // You can add your logic here and return a boolean value
		}else{
			return false;
		}
    }

    type: 'RMActionValidator'
});

View solution in original post

7 REPLIES 7

Harsha Lanka
ServiceNow Employee
ServiceNow Employee

In your code, current is 'not defined'.

Try in below way.

var RMActionValidator = Class.create();
RMActionValidator.prototype = Object.extendsObject( RMActionValidatorSNC,{
    initialize: function(gr) {
                this.currentResPlanGr = gr;
		RMActionValidatorSNC.prototype.initialize.call(this, gr);
    },

    canConfirm: function() {
       if((gs.getUserID()==this.currentResPlanGr.user_resource.manager)||(gs.getUserID()==this.currentResPlanGr.group_resource.manager)){
			return true; // You can add your logic here and return a boolean value
		}else{
			return false;
		}
    }

    type: 'RMActionValidator'
});

Hello @Harsha Lanka 

 

Thanks a lot.

Good Job Guy. 🙂 🙂

Hello,

I used this script to prevent the delete action from showing on resource plans that were confirm, allocated and cancelled.  How would I go about doing the same for planning and requested?

Thanks, Kathryn