- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:04 AM
I am trying to use JSUtil.nil in a business rule but it does not assign to the group. If i directly set the assignment_group to group 1 it will insert the record correctly. Is there a reason JSUtil.nil does not work in a BR?
grTest.priority = 2; | |
grTest.approval = "approved"; | |
if(!JSUtil.nil(Group1)){ | |
grTest.assignment_group = Group1; | |
} | |
else if (!JSUtil.nil(Group2)){ | |
grTest.assignment_group = Group2; | |
} | |
grTest.insert(); | |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:17 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:06 AM
I am sorry , Could you please elaborate more on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:10 AM
if i directly set the assignment group grTest.assignment_group = Group1; or grTest.assignment_group = Group2;
when the task is created it populates with the correct group. I am wanting to check if group1 is blank assign to group 2 but when i try using !JSUtil.nil the group does not populate or the task is not created when the BR runs. So I thought I was doing something wrong bc i dont understand why I cant get this to populate the correct group if one is blank.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:17 AM
why not use JSUtil.notNil() instead of if(!JSutil.nil())
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2015 08:19 AM
Or may it is working properly and it is not setting anything because the values are empty?
Have you tried printing logs?
One more guess, Which version of the instance you are running on ? are you doing this from any scope?