You need to sign in to do that
Don't have an account?
HARISH S 11
To create a custom object 'copy account' and whenever the account is inserted/updated automatically 'Copy account' object also should be inserted/updated/
Hello am bit new to salesforce, can somebody help me with this?
Public class Accountcopycheck{
Set <Id> accid = new Set<Id>();
Public static void Accountcopymethod(List <Account_copy__c> acccpy){
for(Account a :acccpy){
if(acccpy.AccountcopyId != null){
accid.add(a.AccountId);
}
}
List<Account> listacc = [ Select id, name, phone, website from Account where id IN:accid];
if(listacc.size()>0){
for(Account ab:listacc){
for(Account_copy__c acopy:ab.acccpy){
acopy.Account__c=ab.Name;
acopy.Phone__c=ab.phone;
acopy.Website__c=ab.phone;
}
}
}
Public class Accountcopycheck{
Set <Id> accid = new Set<Id>();
Public static void Accountcopymethod(List <Account_copy__c> acccpy){
for(Account a :acccpy){
if(acccpy.AccountcopyId != null){
accid.add(a.AccountId);
}
}
List<Account> listacc = [ Select id, name, phone, website from Account where id IN:accid];
if(listacc.size()>0){
for(Account ab:listacc){
for(Account_copy__c acopy:ab.acccpy){
acopy.Account__c=ab.Name;
acopy.Phone__c=ab.phone;
acopy.Website__c=ab.phone;
}
}
}