Best way to create a field that combines static values with a variable within the record?

jlaue
Kilo Sage

Hi All -

I am looking for the best way to create/populate a custom field on the User form that I will name MGR Email, and it would do the following:

- prefix with a static value of:     mgr

- then grab the value in the Location field for that user (Location on sys_user)

- then suffix it with the email domain:   @xyz.com

So if I had a user record open and that user's location value was 123, then this MGR Email field would be populated for that user as:   mgr123@xyz.com    

If the user's location was empty - then it should result in no value populated within this MGR Email field for that user.

Thank you!!

1 ACCEPTED SOLUTION

Did you try this ?



This should be a before business rule with insert and update check boxes checked. Below is the script.


if (current.location!='')


        current.your_mgr_email_field = 'mgr'+current.location.name+'@xyz.com';


else


        current.your_mgr_email_field = '';



Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

11 REPLIES 11

Hi Sanjiv -



Realized I needed to do a mass update for all existing users for the rule to take effect.   I was able to get this working.   Thanks so much for your help!


I was trying to say, onChnage() client script should be on user field based upon which you want to populate the MGR Email. Suppose there is a caller field and based upon the selected caller you want to populate the MGR Field.



find_real_file.png