Service Catalog Item - How to make assignment group read only (or not changeable)

Michael Gedzelm
Tera Contributor

Hello.  For a service catalog item,  we have a requirement that the assignment group is set SOLELY based on the response to one of the questions in the item (variable).  I have gotten this to work by creating UI policies and a business rule. However, the problem is that a user can still edit the item and directly modify the assignment group. I don't want that to happen.

 

  • I have tried setting assignment group to readonly - g_form.setReadOnly('assignment_group',true); - in an onLoad client script for both the item itself and for the sc_req_item table. Neither worked. I have tried many many things such as doing it in a UI Policy, first making assignment_group not mandatory, etc.
  • I have also tried to set the value back to the odl value using an onChange function, but to do this, I must first determine if the change is happening via code (which is allowed) or via the user directly attempting to change the assignment group field (which is not allowed). I can't do that because g_form doesn't allow me to determine which field has the focus.

Any help is greatly appreciated.  Thanks!

1 ACCEPTED SOLUTION

Hello,

 

if you want to make the assignment group read only for one particular catalog item. Create a Ui ploicy on the sc_req_item table as below:-

 

Saurav11_0-1668017454760.png

 

And then create the UI policy action for assignment group and have it as readonly .

 

Also set the order of the UI policy to 1000:-

 

Saurav11_1-1668017653939.png

 

Please mark my as answer as correct based on Impact.

 

 

View solution in original post

5 REPLIES 5

Saurav11
Kilo Patron
Kilo Patron

hello,

 

I am not sure if i got you correctly so you said "I have gotten this to work by creating UI policies and a business rule." so how is user exactly editing it. Can you paste some screenshot it would be easier to Assist you.

 

Also make sure the applies on requested item checkbox is ticked to true for the UI policy and client script you may have created.

 

Please mark my answer as correct based on Impact.

Sorry Saruav11, I did not explain this correctly.  A user can go to sc_req_item.list or a module to edit an existing request item that was already submitted.  When they do that, they can change the assignment group, which I don't want them to be able to do.  Of course, any change they make will be overridden by the business rule, but to the user, it looks like they made the change.  I want the assignment group to be read only so they can't change it.  Thanks.

 

MichaelGedzelm_0-1668016834366.png

 

Hello,

 

if you want to make the assignment group read only for one particular catalog item. Create a Ui ploicy on the sc_req_item table as below:-

 

Saurav11_0-1668017454760.png

 

And then create the UI policy action for assignment group and have it as readonly .

 

Also set the order of the UI policy to 1000:-

 

Saurav11_1-1668017653939.png

 

Please mark my as answer as correct based on Impact.

 

 

Thank you Suarav11.  That worked and I will mark as correct.  However, unfortunately, the production gatekeepers at our instance frown on and usually don't permit us to write global UI policies on global tables.  They want everything we do to be scoped to our application.  But since the condition is based on a scoped item, maybe they'll permit it.