Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(function executeRule(current, previous /*null when async*/ ) {

// Get Name and User id values
var cleanName = current.name.replace(/,/g, '').trim();

var nameParts = cleanName.split(/\s+/);

var initials = '';
for (var i = 0; i < nameParts.length; i++) {
if (nameParts[i].length > 0) {
initials += nameParts[i][0];
}
}

// Create email alias
var emailAlias = initials.toLowerCase() + '.' + current.user_name.toLowerCase() + '@company.com';

// Set output value to email field
current.email = emailAlias;
current.update();

})(current, previous);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This Business Rule needs to be configured on after whenever new user record is inserted into sys_user table.

Use case: Whenever new users onboarded BR will automatically create unique mail to the user and update it to user record.
Inputs: User Full Name, Unique User ID (Vishnu Kumar, 10321717) Output: Unique email id generated and tagged to user record. (vk.10321717@company.com)
Loading