- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
I strongly dislike the wiki. The content is poorly formatted and sometimes just plain incorrect. ServiceNow customers deserve better. I pulled aside the team lead in charge of discovery content after K14 last year and pointed out several examples and related stories of the pain that this has caused. I was assured that an effort to improve the wiki was under way and that things would improve shortly. To date, I don't see any improvement.
So, I'm going to use this blog post to highlight errors and potential problems so that others can avoid pitfalls:
http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification
3.1 Sample Event Script
The following sample script adds a request.commented event with the user's Sys ID as parm1 and the user's user name for parm2.
if (current.operation() != 'insert' && current.comments.changes()) { gs.eventQueue("request.commented", current, gs.getUserID(), gs.getUserName()); }
See those funny quotes around the request.commented event name? They're "smart quotes". Which means they're 3-byte UTF-8 characters. The other single and double quotes on the page are "normal" (ASCII char 44 and 34) quotes. Why not make them match? If you copy and paste those characters into some editors, you're going to face some confusing error messages about file encodings. The SN script engine will execute them without errors, however. I just don't like it. It's sloppy. As is the fact that the code inside the curly braces is not indented.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.