Making Better Catalog Macros Part 2

I posted very briefly about this around 2 years ago with the promise that I’d write a second more detailed post. This never happened, but its still one of the things I use all the time. And now Geneva has come along, there’s actually a slight ‘hack’ that’s needed to get it working really properly.

So just to recap, when creating a custom UI macro, to make it work a lot nicer, you should always add this input field to it:

<input id=”$[jvar_question_name]” style=”width:50%” name=”$[jvar_question_name]” value=”” class=”cat_item_option questionsettext”/>

What this would do is let g_form.setDisplay and g_form.setMandatory work with the UI macro. It would also save the value to the database as per any other variable.

Simple enough, but what does this actually do?

Continue reading

Securing The Activity Formatter (Or Any Formatter For That Matter)

The activity formatter on a form is a great part of ServiceNow. As long as it’s added to the form, and the table is audited, you can get a quick glance of the most important updates.

However, my only issue with it (and it’s my issue with all formatters), is that you can’t apply an ACL to it. For some users, I don’t want them to see it at all, but I don’t want to have to create a custom view just to hide it.

What I did therefore was found a way to apply ACLs to the formatter. This little trick can be used on all formatters.

Continue reading

Making Better Catalog UI Macros

Many of us would have played around with UI Macros before. They’re a very useful part of the system and they allow for all manners of customisations to the tool. This post is focussed on UI Macros on catalog items as this is where I generally use them the most, to make form submission easier.

One thing that you probably would have noticed is that you can’t use standard g_form methods on the UI macro to hide it, make it mandatory etc. nor can you use UI Policies. You can create custom client scripts to find the elements and hide/show them etc but this can be a bit annoying so I dug a little deeper to understand why and how to get them working. Low and behold, I found a VERY easy way to get them working!

Continue reading