changesTo() function not working for a business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:16 PM
Hi, my business rule configuration is as below.
when to run - before insert, update
script:
var type;
if(current.assignment_group.changesTo('abc'))
{
type = 2;
}
The assignment_group is a reference field on the table. The above piece of code is not running for me.
I am trying to do something like this - current.Display_value_of_Assignment_group.changesTo('abc').
Can anyone please help in explaining if this is achievable and how changesTo() function work with reference fields.
Thank you!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:18 PM
hello
can you try with below format by giving the sys_id of the group record instead of name?
var type;
if(current.assignment_group.changesTo('sys_id_of_the_group'))
{
type = 2;
}
Hope this helps
Mark the answer correct if this helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:27 PM
Thanks for your response, but according to the requirement, I do not want to use the sys id of the group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2022 01:18 PM
Try using this
if(current.assignment_group.getDisplayValue() == 'abc'){
}