How to run a business rule on change of the field in the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2018 03:46 AM
Hello experts,
I have a question,
I want that when a user changes the value of a field on incident form, a business rule is called.
I know it is easy to do with client script ( onchange type) , but in my case, I want a business rule to be called.
Can someone please help ?
Thanks!
- Labels:
-
User Experience and Design

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2018 11:28 AM
if(current.field_name != previous.field_name)
{
current.description = previous.short_description; //Action you want to perform on change the value
}
it will definitely work as onChange.
Mark correct or helpful if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2021 06:58 AM
Please don't do it.. Use changes() instead..
if(current.field_name.changes())
{
current.description = previous.short_description; //Action you want to perform on change the value
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 10:54 AM
Did you ever find a way to run server scripts when a field changes without having to submit the form?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2021 11:55 PM
You can use the GlideAjax for such a case when you want to trigger a server side script with an action you took on the UI.
You will need a client script and a script include.
https://developer.servicenow.com/dev.do#!/reference/api/quebec/client/c_GlideAjaxAPI