- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 11:45 PM
When a user has checked the "Follow" checkbox, then displays the user's name in the "Follow by" field. The BR script is not working, do I need other script/logic or just modify it?
(function executeRule(current, previous) {
if (current.u_follow == true) {
var user = gs.getUser();
current.u_follow_by = gs.getUserDisplayName();
}
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2023 11:51 PM
you could just do this
current.u_followed_by = gs.getUser().getDisplayName();
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 01:05 AM
Just copy and paste this script and check if it displays the name. I believe it should
One more best practice would be - Transfer the if condition in the "When to run" section of Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 12:59 AM
This is the current script and still no result:
Am I still missing something in the code or do I need to configure the field configuration?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 01:05 AM
Just copy and paste this script and check if it displays the name. I believe it should
One more best practice would be - Transfer the if condition in the "When to run" section of Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 04:31 AM
it works, but after a couple of minutes the field shows System Administrator instead of the user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 05:11 AM
Hey
Can you provide me Screenshot of your Business Rule?
I'm typically interested in Script and "When to Run" section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2023 05:24 AM