Technical Articles
SAP SuccessFactors Employee Central – Automatically generate email addresses and phone number for the employees during hiring.
How to Automatically generate email addresses and phone number for the employees during hiring.
Requirement:
If First name is Test and Last name is Emaildefault were to be hired, his email address would have to be Test.Emaildefault@tbc.com, Email Type to be Business and Is Primary to be Yes.
Also Phone Type to be Office, Country Code to be +44, Phone Number to be 000000 and Is Primary to be Yes.
It should automatically default or fill those fields.
Lets Start!!!!!!
Step:1
Navigation: EC-> Admin Tools -> Search for Configure Business Rules
Create the rule as per this screen below for Email default.
Points to be noted:
- Base object has to be Employee Information as you need this rule to kick in while hiring.
- Format() is a function that comes shipped. There are many other useful functions that you can use out of the box
- Format() lets you use java style runtime variables %s. The rule here essentially means replace the first %s with the first name and the next %s with the last name of the employee.
Step:2
Now tie the business rule you created for emailInfo
Navigation: EC->Admin Tools-> Search for “Manage Business Configuration”
Step:3
Navigation: EC-> Admin Tools -> Search for Configure Business Rules
Create the rule as per this screen below for Phone default.
Points to be noted:
Base object has to be Employee Information as you need this rule to kick in while hiring.
Step:4
Now tie the business rule you created for phoneInfo
Navigation: EC->Admin Tools-> Search for “Manage Business Configuration”
Step:5
Let’s take our rule for a spin by trying to hire an employee.
Navigation: EC->Admin Tools-> Search for ‘Add New Employee’
Check the Email and Phone Info data.
Fields are automatically defaulted.
Looks all good!
Hope this was helpful.
Regards,
Venkata Subbarao Pathangi
Interesting post, but in 8 years implementing EC I have never had the request to set up email addresses this way. The nuggets in this post are setting the country code and 'business'. However, for this to be scalable for a global implementation then your rule would become very complex and may find it easier referencing the company table.
Thanks
Thanks Venkata for sharing.
One of my clients had similar requirement.
Gr8...Thanks Venkata, this is really useful.
Is there any possibility to create USERNAME automatically while hiring the employee, in similar logic of email id creation.
Thank you venkata, Useful
What will happen, if you got two people having the same name in the company?
There is no check logic, right?
Hi Sebastian,
We can put logic.
The solution is fairly simple. Just create the email address in the rule and check for its availability in the EC database. If already available, suffix the email with an incremental number, else, just use the email. But…
Step 1: Create MDF Object – cust_email
Navigation:EC->Admin Tools-> Search for “Configure Object Definitions”.
Just create an object with effective dating set to none, API visibility set to editable and retain the External Code and Name. Everything else is optional and can be configured on a need basis.
Now get object cust_email into the business rule
For the moment let’s assume that the aforementioned BOOMI process already exists and keeps the MDF object cust_email afresh with all the new email addresses as and when they are generated.
With that assumption let’s understand the business rule here.
For starters, there is an if statement. The if statement checks for the existence of the email address in the MDF object. If it does exist-> then suffix the email address with an incremental number else just use the email address.
the Then Statement has a few new faces
So the Sequence object has to be created beforehand.
Navigation:EC->Admin Tools-> Search for “Manage Data” -> Create new sequence.
The sequence starts with the number 1 and it’s auto-incremented in steps of 1.
Now the business rule as such is in place. Provided the cust_email object is updated every now and then we are assured of a unique email address every time a new person is hired.
Regards,
Venkata Subbarao Pathangi
Hello,
Instead of first name i use "Preferred Name". But when i test it doesn't pull the preferred name through. I get the following: nullSmit@abc.co.za
Does this mean "preferred anme is not available for this type rule?
Kind regards
Adele