You need to sign in to do that
Don't have an account?
bikla78
APEX Splitting up full name into First and Last
I have a field called Product.Name that contains the first and last name of an employee. I also have 2 custom fields called Product.FirstName and Product.LastName. How can I create a trigger that automatically looks for a space in the Product.name field to place the first name in the product.firstname and product.lastname field when a new product is created?
Wasula
Use the Trigger.New on the Insert event of your Product object. Use the String class to find the space then parse the string. Do a search in the apex code library http://www.salesforce.com/us/developer/docs/apexcode/index.htm for String.indexOf and that should get you started.