In The Change Form in Schedule Planned start date and End Date should Editable for particular XYZ Gr

nameisnani
Mega Sage

Hi All ,

 

In The Change Form in Schedule Planned start date and End Date should Editable for particular XYZ Group for entire change cycle they can able edit .

 

Notes - 

I Think i need to write OnChange Cilent Script 

  - I need to Get Current Logged in user 

  - I Need to check whether that user belongs to XYZ Group 

  - If user = XYZ Group , then user can able to edit schedule planned start and date .

  - If user != XYZ Group , then it should  read only .

 

* We have to do this for this particular XYZ Group .

* For some groups they have made readonly by using UIPolicy , 

* I have tried UIPolicy It doesn't work ,

* We need to write Cilent script 

 

SunilKumarPadh_0-1667351748681.png

Please help me 

 

@Saurav11 @kamlesh kjmar @Radhika Aluru 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Please do the below:-

 

Create a display BR on change request table with below code:-

 

Saurav11_0-1667358384149.png

 

(function executeRule(current, previous /*null when async*/) {

	g_scratchpad.group='false';
	if(gs.getUser().isMemberOf('Database'))
		{
			g_scratchpad.group='true';
		}

})(current, previous);

 

Then in the existing UI policy you have just delete the UI policy action from it:-

 

Saurav11_1-1667358438164.png

 

And then in the UI policy itself in the execute if true section use the below code:-

 

Saurav11_2-1667358509100.png

 

 

function onCondition() {
    var group = g_scratchpad.group;
	alert(group);
    if (group == 'true') {
    g_form.setReadOnly('start_date',false);
    g_form.setReadOnly('end_date',false);
    } else {
    g_form.setReadOnly('start_date',true);
    g_form.setReadOnly('end_date',true);
    }
}

 

 

Please mark my answer as correct based on Impact.

 

View solution in original post

7 REPLIES 7

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Please do the below:-

 

Create a display BR on change request table with below code:-

 

Saurav11_0-1667358384149.png

 

(function executeRule(current, previous /*null when async*/) {

	g_scratchpad.group='false';
	if(gs.getUser().isMemberOf('Database'))
		{
			g_scratchpad.group='true';
		}

})(current, previous);

 

Then in the existing UI policy you have just delete the UI policy action from it:-

 

Saurav11_1-1667358438164.png

 

And then in the UI policy itself in the execute if true section use the below code:-

 

Saurav11_2-1667358509100.png

 

 

function onCondition() {
    var group = g_scratchpad.group;
	alert(group);
    if (group == 'true') {
    g_form.setReadOnly('start_date',false);
    g_form.setReadOnly('end_date',false);
    } else {
    g_form.setReadOnly('start_date',true);
    g_form.setReadOnly('end_date',true);
    }
}

 

 

Please mark my answer as correct based on Impact.

 

Hello,

 

If my answer helped you can you also mark it as correct.

 

Thanks.

 Hi @Saurav11 

 

what should i give here 

SunilKumarPadh_0-1667441712275.png

 

In the execute if false keep it empty that should be fine.

 

Please mark my answer as correct based on Impact.