You need to sign in to do that
Don't have an account?
sales@myvarma
hey when new lead converts to account if the new account name already their the data in new account must update in old account any one help me
when ever we insert record in account if same name exist then the data must update in old record
help me
help me
You have to have a trigger in account and develop a mechanisam to achieve this
Thanks
Shaijan
All the Best
trigger tocAccountTrigger on Account (before update) {
Map<Id, Account> newAccountMap = Trigger.newMap;
if (Trigger.isBefore)
{
if (Trigger.isUpdate)
{
for (Profile p : [select name from Profile])
for (Account a : Trigger.new) {
if (((a.IBM_Id__c == '' || a.IBM_Id__c == null) && a.tocSourceSystem__c=='IBM') )
{
a.IBM_Id__c.addError('IBM Id should be present');
}
for (Account oldAccount : Trigger.old)
{
Account newAccount = newAccountMap.get(a.Id);
if ((newAccount.tocSourceSystem__c=='IBM')&&(newAccount.IBM_Id__c != '')&&(p.name != 'System Administrator'))
{
OwnerId = oldAccount.OwnerId; newAccount.Name = oldAccount.Name;
newAccount.tfcmCustomerName__c = oldAccount.tfcmCustomerName__c;
newAccount.Phone = oldAccount.Phone;
newAccount.Fax = oldAccount.Fax;
newAccount.ShippingStreet = oldAccount.ShippingStreet;
newAccount.ShippingCity = oldAccount.ShippingCity;
newAccount.ShippingState = oldAccount.ShippingState;
newAccount.ShippingPostalCode = oldAccount.ShippingPostalCode;
newAccount.ShippingCountry = oldAccount.ShippingCountry;
newAccount.Segment__c = oldAccount.Segment__c;
}
}
}
}
}
}