Setting Value On Catalog GlideList

A colleague showed me last week how to turn a List Collector variable (slush bucket) into a GlideList variable like on forms. I don’t know how long this option has been around for [edit: Was introduced with Helsinki] but it’s super easy (and I was very impressed because I’ve wanted to catalog GlideList fields in ages). All you do is create a variable of type List Collector as normal and then set the ‘Variable Attributes’ field to ‘glide_list’.

And that’s all there is to it, navigate to the catalog form and you’ll see the Glide List variable. I thought that was the end of it but then the next step was to populate the variable using a client script. It turns out g_form.setValue doesn’t work as expected. What next then?

Continue reading

Decrypting Password Fields Automatically

We had an issue recently with some interfaces after client’s Istanbul upgrade. Initially we thought someone may have updated a password on one of the data sources. We had to then do some simple coding as a background script to see what the password actually was (and repeated per interface during debugging).

This led me to write the attached code below. Very simply it adds a padlock icon next to each password2 field, when clicking the icon, it’ll pop up showing the decrypted value.

(password2 fields can be decrypted whereas password type fields such as the password field on the sys_user table use a one way encryption method so this functionality can’t be used on those fields.)

Aug 30 2017 1-01 PM

Note: This uses JQuery to insert the icon so will flag up on an ACE report. It inserts the action in the same manner which g_form.addDecoration uses

Continue reading

Accessing Field Information From GlideRecord

I made an accidental discovery a few days ago. I searched the wiki and couldn’t see any documentation around it. It turns out every field returned in a GlideRecord also comes with a property that contains all the dictionary values.

Why is this useful? For around 99% of the time it’s not and you can pretend it’s not there. For me, I have been writing functionality that automatically checks all scripts in the system that they have adhered to a particular rule set. To do this, I needed to know if a table had any scripting fields on there. Initially I was doing a GlideRecord on the sys_dictionary table searching for the details. However, with this route, no database query was required anymore.
Continue reading