Hi, You can achieve this functionality through workflow where you can set Rule Criteria:Account: Account Name not equal to null Evaluation CriteriaEvaluate the rule when a record is created// as you want this at time of insertion only
then you can add imediate action Field update where you can update Account name with this formula 'Mr.'+ Name
my code is
==>
trigger Mr on Account (before insert) { list prefixName = new list();
List a1=[Select Name from Account where Account.name=:trigger.new[0].name];
}
Try with below code it will help !!
All Answers
You can achieve this functionality through workflow
where you can set Rule Criteria:Account: Account Name not equal to null
Evaluation CriteriaEvaluate the rule when a record is created // as you want this at time of insertion only
then you can add imediate action Field update
where you can update Account name with this formula
'Mr.'+ Name
it will work while you create new record.
please let me know if this will help,
Thanks,
Keyur Modi
can you mention , in which step you are getting error and what error it is ??
Thanks,
Keyur Modi
Try with below code it will help !!