How to auto populate user id by using first&last names in user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 09:18 PM
how to auto-populate user id with the business rule.please provide example script.
Thankq
- Labels:
-
User Experience and Design

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2018 09:25 PM
you can try with below script in After insert Business Rule on sys_user table.
(function executeRule(current, previous /*null when async*/) {
current.user_name = current.first_name + '&' + current.last_name;
})(current, previous);
if there is any other format you need to form then you can change the script accordingly. but using this way I am not sure how you will maintain the unique user id if first_name and last_name are same for many users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 12:31 AM
Hello Vinod,
Please confirm if you need to auto generate user ID using First and last name from business rule?
Regards,
Tushar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2018 12:49 AM
HI,
I will suggest to use before Insert BR on sys_user table.
(function executeRule(current, previous /*null when async*/) {
current.user_name = current.first_name + '.' + current.last_name;
})(current, previous);
So here you dont need to update the record again.
In after BR you will need to put current.update as well at the end.
Thanks,
Ashutosh
Please mark as helpful or correct.