+ Start a Discussion
Dhilip DussaDhilip Dussa 

update field

Hi all,

I have one field called address(Textarea long) if i gave address in second line need to auto populate in firstline with comma separated

And if anyone gave # in second line need to remove

Address: orus
Khan AnasKhan Anas (Salesforce Developers) 
Hi Dhilip,

Greetings to you!

Please refer to the below links with a similar discussion which might help you further with the above requirement.



I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas
Raj VakatiRaj Vakati

you need to use the before insert ,before update trigger .. 

Split the text based on the new line ie.\n .. and update it with comma separated and append it ..

String myString = '345 Shoreline Park\nMountain View, CA 94043\nUSA';
String singleLineVersion = myString.replaceAll('\\n', ', ');