How to highlight a field as a result of being changed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 10:07 AM
Hi all,
Does anyone have any insight as to how to cause the state field on an incident to take on a highlight (likely in the list view)?
To explain further, for our current setup, an incident can be set to a particular state (5, "Awaiting customer info"), which, when submitted will cause an email to be sent to the customer asking for more information. When this customer replies to the email, the state changes from 5 to 9 ("Work in Progress"). I would like to change the state field to have a colored background at this point.
A couple of approaches I took are as follows:
1. I tried to set up a field style where the value was set to
javascript: current.state.changesFrom(5) && current.state.changesTo(9)
2. I tried setting up an onChange() client script which read
if (oldValue == 5 && newValue == 9)
gs_form.getControl('state').style.backgroundColor = 'LimeGreen';
(this only worked when manually changing it from the ticket, it did NOT work with the inbound action)
3. I tried editing the inbound action with a line like
current.state.style.backgroundColor = 'LimeGreen';
or
current.getControl('state').style.backgroundColor = 'LimeGreen';
(these were undefined so it was posting an error)
So does anyone have any suggestions or point me in the right direction?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 10:33 AM
Solution #2 is the way to go.
You need to add an onLoad() script which applies the color style when the record is opened and the value is 9.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 10:49 AM
Thank you for replying.
I considered that, but it only needs to colored when it was previously 5 and then changed to 9. So how would i access the previous Value in the onLoad script? would the changesFrom() method work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 10:57 AM
No, changesFrom is server side and not available to the client.
As you have a very specific condition you need to store the previous state somewhere on the record. Maybe create a hidden field which you then query with the onLoad client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2014 10:52 PM
Is there a way to call client script function in a business rule?