How to make the field Read only on Incident in self service view

robinpaul
Kilo Contributor

Hi All,

How to make the field (u_short_description) Read only on Incident form in self service view for all the Users ,except the users belongs to

CAB Approval Assignment Group and Database Assignment Group.

i.e., The   short description field should be editable for the users belongs to   Assignment Groups(CAB Approval and Database)

Any help would be appreciated .Thanks in advance.

5 REPLIES 5

nayanawadhiya1
Kilo Sage

Hey Robin,



Write a onLoad Client Script using this script -


if(gs.getUser().isMemberOf('Group_name') || gs.getUser().isMemberOf('Group_name'))


{


g_form.setReadOnly('field_name',true);


}


else


{


g_form.setReadOnly('field_name',true);


}



NOTE -


For view SPECIFIC, unchecked the Global field and write the VIEW name on VIEW FIELD.



find_real_file.png


damodarreddyp
ServiceNow Employee
ServiceNow Employee

Hi Robin,



In UI Policy, 'When to Apply' section uncheck 'global', then you can select a view for which the UI Policy to be applied.



You can write the relevent conditions to your UI policy to apply and this will be specific to self service view.


Screen Shot 2017-04-03 at 1.37.30 PM.png


dravvyramlochun
ServiceNow Employee
ServiceNow Employee

Hello Robin,



This might have been answered in HERE: make incident fields readonly



Thanks,


Dravvy



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


Alikutty A
Tera Sage

Hi Robin,



You can use a UI policy for this requirement, Make sure you select view as self service and add your group condition. Once you create a UI policy, Setup a read ui policy action on the short description field



find_real_file.png





Thanks


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