update in a display business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2012 01:35 AM
Hi,
I have a request from the business :
they want that if the service desk enter a comment, the record appears in the list with a specific color (that's easy)
But then, if someone from a specific group opens the record, this should put the record color to normal.
It means I have to update the record when the user opens it.
I tried to do that with a display business rule, but if I do a current.update() when the users open the form, he gets a blank screen.
I tried to use gs.setRedirect, but without result.
Have you any idea on how to update a record when someone opens the form? Without any action from him?
Thanks a lot
rgds
Xavier
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2012 04:14 PM
Can you set a g_scratchpad variable in the "display" Business Rule, check the variable in an onLoad Client Script, and modify the value accordingly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-07-2012 11:12 PM
Hi,
thanks for the answer.
But then, how to update the record himself?
I can't update the current record in the onload client script isn't it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-08-2012 10:06 AM
What is it in the current record that you need to actually change?
(you can manipulate "current" values in a display business rule, in some cases, just as long as you don't call update())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2012 08:17 PM
Was trying to do the same thing today for a client as required by your business and ran in to the same issue as you mentioned.
Got around it by NOT using "current.update()" but rather do a glide record query and updating the current record. Below is the code inside my display business rule on task table.
var gr = new GlideRecord(current.sys_class_name);
gr.get(current.sys_id);
gr.{your_flag_field_to_update} = false;
gr.update();