+ Start a Discussion

Parsing MailingStreet


Hello all,

                 I have a requirement where i have to parse the Mailingstreet with the delimiter as newline (Carriage return) and populate the parsed lines into other custom fields. 


For eg:   

                  MailingStreet:   Central park Residency

                                              Suite: 410 

                                              123 N West Drive


I want to parse the mailing street into 3 different lines and place those 3 parsed lines into 3 different custom fields.


Address line 1:  Central park Residency

Address line 2:  Suite: 410 

Address line 3: 123 N West Drive


Can any one suggest how to start with this? 



Best Answer chosen by Admin (Salesforce Developers) 

You could certainly do this in an Apex trigger - before insert/update of the account, extract this field, use the split method to break it up on the carriage returns and then populate the custom fields as required.


I suspect you could also achieve this via workflow field updates, using the FIND and LEFT functions.