The CreatorCon Call for Content is officially open! Get started here.

Make Variables visible and mandatory after submit for people with specific roles

kailashthiyagar
Kilo Guru

I m working on a service catalog item. I have a list of variables which i need to make visible and mandatory on submit for people with certain roles. How to do that using UI policy..

In the UI policy, i selected, "Applies on Requested Items" and removed "Applies on Item Catalog view" checkbox.

Added the UI action as "Visible" and "Mandatory" true

But it doesnt help

1 ACCEPTED SOLUTION

I have done the changes. it is wrkg fine now.



Note: kindly change the password. Someone might mis use it.


Regards
Harish

View solution in original post

17 REPLIES 17

You need to uncheck the option Applies to catalog item view and it wont run on the form.



Thanks


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


I have included it already..



client Script.png


Hi Kailash,



Did you try the way I suggested in my last response? Please try that and let me know. The approach which I suggested will ensure that the script won't run on the Catalog Item form, rather on Requested Item and Catalog Task form. Also the script checks the logged in user's role as you have asked in your question.


Please let me know if you face problem after trying the same.



I hope this helps.Please mark correct/helpful based on impact


the code if(!g_form.isNewRecord()) will hide the variable when you open the catalog form.use ! (NOT) before g_form


Regards
Harish

Harish KM
Kilo Patron
Kilo Patron

Use


if(!g_form.isNewRecord()) // instead of g_form.isNewrecord()


  {


  g_form.setDisplay('code_is_consistently_formatted',false);


  }


  else{


  g_form.setDisplay('code_is_consistently_formatted',true);


  }


Regards
Harish