- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2016 01:30 AM
Hi,
I want the "work notes" - field to be the default view when viewing a ticket (instead of the "Additional Comments"- field showing), so it will look like this:
I found a record in the dictionary called "Work notes" on the task table, and tried setting this to default value "true". Then I get the desired result when viewing a ticket, but not when creating a new one. It then shows both the "Additional Comments" and the "Work notes"-field, and it says "true" in the "Work Notes"-field. I belive the original behavior is both of the fields showing like this, but of course not showing the "true" statement in the "Work notes"-field.
Anyone got an idea as to how I can default show the "work notes" (work notes = ticked) instead of the additional comments? It would be OK for both fields showing on a new ticket as well, but I would not want to see "true" in the work notes - field.
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2016 05:32 AM
Hi Ina,
Look what I found... Two user preferences that do what you want... you can make these a single field or expand them to show both. You can default to work notes too!
I just changed mine on incident and noted the changes in sys_user_preferences. If you want make those the default for people, just remove the user name and change the System field to true (checked) and insert&save the new record. It doesn't prevent people from changing it to the way they want (collapsed and comments first), but it gives you a default for noobs.
Let me know if you need more help or if that answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 08:03 AM
Care to share your solution?
I am wrestling with the same problem and due the fact that 'glide.ui.incident.stream_input' is created every time a user changes this value, I have not been able to find a solution working with ACLs (" Note that a create ACL with a condition that a field contain a specific value always evaluates as false, as fields on new records are considered empty until saved.").
Best regards,
Andreas Larsson

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 08:47 AM
So, here is what I have learned. You can deny creation of additional preferences, so the default upon opening a record matches the system preferences you have defined. For conversation sake, let's say you have set the default to show work_notes. When you enter a new record (one that you haven't been in before) work_notes will display first 100% of the time. However, if you switch to comments and update that record, when you re-enter it the comments will be displayed. I haven't figured out what is causing that. I can confirm that there have been no additional user preferences written.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 09:00 AM
gs.getUserId() is not a function.
gs.getUserID() is - it returns a sys_id, which means myUser.hasRole('admin') is not going to work (even if you got the right function.)
I think what you are after is:
var myUser = gs.getUser();
if (!myUser.hasRole('admin'))
or combined in one
if (!gs.getUser().hasRole('admin'))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 09:20 AM
Any insight as to why there seems to still be a preference even though there is no record written on the sys_user_preference table? I did fix the code as you suggested...
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var myUser = gs.getUser();
if (!myUser.hasRole('admin')){
current.setAbortAction(true);
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-03-2017 09:34 AM
Is it using a system/global preference?