Kieran Anson
Kilo Patron

A common request on the community is the ability to make an item on an order guide mandatory so end users are unable to toggle it off. I'm surprised ServiceNow still hasn't included this as a capability and I do hope, with the new UI around the corner, that it's introduced.

For now, I've made a small customisation that can be applied to an instance without too much effort! The below Developer Share will allow you to set a rule base on an order guide as mandatory.

find_real_file.png

 

Download Here

 

How do I make an item Mandatory?

On the order guide, you'll have rules setup which will define when an order guide should show a particular catalog item. This update set will add a checkbox to the form which, when checked, will make the toggle read-only in the service portal widget.

find_real_file.png

So, how does it work?

The SC Order Guide widget has been cloned and the server-side script updated to lookup the rule base to determine whether the item is mandatory or not. There is then an ng-disabled directive added to the toggle element which will disable the ability to toggle the inclusion of the item if a rule base is found.

To make this update set as seamless as possible, a new service portal page has been created (order_guide) with a route map setup to redirect any requests to sc_cat_item_guide (the OOB order guide page) to the customised widget.

This doesn't work for my portal?

The route map has only been configured for the default "sp" service portal. If you would like this to run for your custom portal, modify the sp_page_route_map entry and include your portal in the list.

find_real_file.png

 

If you found this helpful, I'd appreciate a thumbs up and subscribe to this article for future updates!

Comments
Allen Andreas
Administrator
Administrator

Hi Kieran,

Thanks for providing this. How would one indicate that a catalog item is mandatory for this feature to then leverage and not allow it to be toggled off?

-Allen

Kieran Anson
Kilo Patron

Doh! Helps if I add that info....just added it in to the article ha

Allen Andreas
Administrator
Administrator

Awesome, thanks! Great info!

The SN Nerd
Giga Sage
Giga Sage

I like your approach of routing to custom pages with cloned widgets. Makes it super easy to rollback to OOB widgets after upgrades. Nice one.

Jeremy Estes1
Tera Explorer

Looks like the widget does not show quantity for any of the items even when show quantity is enabled. 

Evan McElfresh
Giga Guru

The developer script page says this is only compatible with Quebec and Rome. Is that explicitly true, or will it work with, say Washington DC?

 

And is this STILL the only solution?

Samdavid46
Giga Explorer

Hello @Evan McElfresh , did you find any alternatives?

Evan McElfresh
Giga Guru

@Samdavid46 , I did not find a true alternative to provide this functionality. I developed a workaround that gave the submitting user more control on the first page, instead of the options page. I know this is vague, but my use case is pretty customized, so I don't know that it would help much to go into further detail.

Kieran Anson
Kilo Patron

@Evan McElfresh @Samdavid46 This should still work, I've updated the share page to reflect compatible releases

Version history
Last update:
‎10-28-2021 02:48 PM
Updated by: