function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Adeline MooreAdeline Moore 

I need Code help Please!!

I have a field in my Contact record Labeled

NATIONAL Email = We generate an email for each new Contact that is becomming a volunteer

We use this email format

Firstname.CanineName.First 6 letters of last name@NATIONALCrisisResponseCanines.org

Is there a code I can use to Autogenerate these email address in the Custom field?

Please help
 
Best Answer chosen by Adeline Moore
Roshni RahulRoshni Rahul
Hi Adeline,

Got solution for you. Create formula field names National Email with return type as text.
FirstName  + "." + LEFT(LastName,6)+ "@NATIONALCrisisResponseCanines.org"

User-added image

So you get the output as follows

User-added image
Its working fine for me. If my answer is informative, please mark it as best answer.

Regards
Roshni
 

All Answers

Roshni RahulRoshni Rahul
Hi Adeline,

Got solution for you. Create formula field names National Email with return type as text.
FirstName  + "." + LEFT(LastName,6)+ "@NATIONALCrisisResponseCanines.org"

User-added image

So you get the output as follows

User-added image
Its working fine for me. If my answer is informative, please mark it as best answer.

Regards
Roshni
 
This was selected as the best answer
Adeline MooreAdeline Moore
Thank you so much it worked!!!
Adeline MooreAdeline Moore
Hi Roshni, 
Do you know how I can use this formula to update  contacts that are already in the System?
Adeline MooreAdeline Moore
The above code isnt adding the Canine's name between the first and last name. I tried to add coding but am getting an error
User-added image

Can you see what's wrong with the added code?

Thank you
Roshni RahulRoshni Rahul
what is the API name of the Canine's Name field? Isnt that a custom field that you created? You can get the field name from Insert Field button if you have created.