Make Assignment read only based on the form selected

DSV22
Tera Contributor

Hi

 

Want to make the Assignment group read only when a catalog item selected and for admin it should be editable

 

can anyone help me with this 

11 REPLIES 11

Any help expert @Sandeep Rajput 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Thanks for tagging. Shared by inputs.

Hi , @DSV22 , @Sandeep Rajput @Dr Atul G- LNG , 

 

Please Check my Solution , It is Working , I have Tested In my PDI 

 

Thanks Regards ,

Badrinarayan

Sid_Takali
Kilo Patron
Kilo Patron

Hi @DSV22 Create a Write ACL on a table and use below script

 

  • Type: Record

  • Operation: write

  • Table: Your table

  • Script Condition below

 

(current.catalog_item_field != ' ' && gs.hasRole('admin'))

 

 

Brad Bowman
Kilo Patron
Kilo Patron

If you want to make the Assignment group variable read only on the Record Producer request form, then try an onLoad Catalog Client Script:

function onLoad() {
    if (!g_user.hasRole('admin')) {
		g_form.setReadOnly('assignment_group', true);
	}
}

 

If you want to make the Assignment group field on the ensuing incident record read only, but only if the incident was created via (a certain) Record Producer, then make sure the Record Producer is populating a field on the incident record that is unique - otherwise unused, or contains a unique value.  For example, in the Record Producer script have something like 

current.contact_type = 'self-service';

If you either don't use the Channel field normally, or no one or no process would ever otherwise populate it with this value when creating an incident outside of this Record Producer.  Then you can create an ACL or Catalog Client Script to only allow users with the admin role to update the Assignment group field on these incident records.