display Business rules and some issues

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2016 04:17 PM
I just noticed a bit strange behavior:
1. Create onDisplay business rule on Incident table,which sets Short Description to 'Hello' (this runs for any incident every time):
current.short_description = 'hello';
2. Open any existing incident - you'll see 'Hello' in a short description
3. Change anything on a form, but don't touch short description and save the incident
4. ...what would you expect to happen?
'Hello' forced by a business rule to Short Description has not been saved - you can check that in the list of incidents.
This affects all versions... did I miss something on how ondisplay business rules work?
- Labels:
-
Scripting and Coding
- 2,544 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 08:35 AM
well, yes.. there are multiple ways and workarounds I can use to force data to be saved, that's not the point.
The point is that I was under impression that you can modify form data with display business rules and it will be saved if you click SAVE or UPDATE, but it seems that it doesn't work that way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-20-2016 09:03 AM
Maybe good point for a HI ticket but since it is not documented by ServiceNow how display BR should behave in such use case it may not be considered as error. ServiceNow expects us probably to use it just for populating g_scratchpad, not for updating field values. But you are right that this is interesting question, but no real blocker for any development so I guess no change will happen with that.