How to ‘Show XML’ – the not so annoying way

General 5 Comments »
by:

The one thing that possibly annoys me the most on Servicenow is the fact that the ‘Show XML’ pop-up is automatically closed when it is no longer in focus. Actually, I am not sure when the window is closed because two hours of investigating on how Servicenow accomplishes this behaviour yielded no results. Chrome developer tools do not show any event listeners on this, window, document, body or any other element for that matter. Especially while developing you might want to keep the XML open to go back and forth between the record (and all data that might not be shown on the form itself) and what other page or program you have open. The first idea that comes to mind is editing the UI Action itself. But it comes as no surprise that there actually is no UI Action called ‘Show XML’ and inspecting the link from the context menu on the form shows that the href property for the div points to ‘xmlView(table, sysId)’. And in true Servicenow fashion, this is undocumented and inaccessible for editing.
Continue reading…»

Organizing (a lot of) code with a controller pattern

General No Comments »
by:

ServiceNow does a lot of things right. It allows for a great deal of extending and customizing, and compared to most other SaaS solutions I see in practice it does so very well. You write your custom logic, save it as a Script Include and use Business Rules, UI Actions and Scheduled Jobs to invoke your code. For most use cases the Script Include itself is enough to organize your code. But when the amount of functions needed becomes larger, there comes a point when one Script Include is just not enough too properly organize your code. Scrolling through 1500 lines of code is a pain even when it is properly formatted and well written.
Continue reading…»