Service catalog container Start mandatory fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 07:25 AM
I m working on Service catalog. I have multiple container start and each has a bunch of controls which are mandatory.
I have drop down and which has multiple request types. On select of one request type, i show the particular set of container start and on select of another request type , i will show different set of container start. This works fine..
But on submit, it takes into account of the hidden container start controls and complains that "mandatory fields are missing"
Should i create UI policy at control levels rather than at container level? If its the only option, for each request type selection, i have to add 20+ catalog UI policy action to show the controls and make it mandatory..
Can you please help on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:07 AM
Hi Balsu and Abilash,
I got that.. The problem as i stated in my post, i have around 20+ controls which i have to make visible and mandatory on select of each request type.
To over come that only, i have created container start container end approach. but these mandatory fields causing issues for hidden container starts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:13 AM
If I am correct UI policy does not work for container start.
Variable Types - ServiceNow Wiki
For defining behavior for all fields - variables -mandatory, read only, visible, I would recommend UI policy. it is best practice and I read somewhere on the wiki that we should avoid catalog scripts whenever we could use UI Policy. My understanding is that script "talks" to catalog item via server (going out from your instance to SNOW server and back), while UI policy stays in the instance.
Vlady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:13 AM
If your requirement is that complicated, then don't ever make those fields mandatory while declaring them in the catalog item i.e in the dictionary entry of the field.
Instead at the load of the form, hide all those variables and on the basis of the value in the field which controls the form and its visibility - make the other fields display and mark the necessary fields as mandatory.
In this way, the unnecessary fields will be hidden and wont be mandatory and you can submit the form without an issue. It gives good experience also because you are hiding all the variables initially, once the customer selects the value in the controlling field, the only neccessary fields will be visible to them.
I prefer UI policy if the requirement is simple and straight forward.
For example:
field_a, field_b, field_c, field_d
field_a is the controlling field
Then write an onLoad script to hide - field_b, field_c, field_d
Then show the neccessary fields on the basis of the value gets selected in field_a through onChange script like below-
Mark if it is helpful or correct, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2016 08:18 AM
Thanks all.. And from the overall discussion, it sounds like we need to use Catalog UI policy as it is the best for Catalog Item. And also i shouldnt use the Container start approach. I have to go with making individual fields visible on change of request type(controlling field),
Either i use UI policy or the script, i have to do things at indiviual control/item level and not at the container level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2017 05:21 AM
Hi Srikanth,
I have the exact requirement , and have created catalog client script 'on change' of variable 'type' ( type : is a reference variable). I am also using the container start to hide few variables depending on the types. But unable to find the result.
I want to make different containers visible depending on the type. and make it mandatory also.
Could you please suggest ?