• Rahul Agarwal 45
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Hello I have been trying to update the contact record's address from account respective account record. But I have ended up in error saying

"Error: Compile Error: unexpected token: '<' at line 7 column 5". Below is the code, could somebody please help me?

trigger updatecontact1 on  Contact (after insert){
    List<contact> lstConUpdate = new List<Contact>();
    set<Id> sAccId = new set<Id>();
    for(Contact con: trigger.new){
        sAccId.add(con.AccountId);
    }
List<Account> lstAccount = [select id, Address_1__c, Address_2__c,City__c,Country__c(select id,Address_1__c, Address_2__c,City__c,Country__c from contacts) from account where id IN: sAccId];
    for(Account acc: lstAccount){
        for(Contact con: acc.contacts){
            con.Address_1__c = acc.Address_1__c;
            con.Address_2__c = acc.Address_2__c;
            con.City__c=acc.City__c;
            con.Country__c=acc.Country;
            lstConUpdate.add(con);
        }
    }
    if(lstConUpdate.size() > 0){
        update lstConUpdate;
    }   
}
Hi,

I have a custom object.
The track history is check for some of the fields.

Create a report from Create Reports.
Went to the Reports tab and opened that report and saved it.
But I actually need to create a history report.
I am not able to find the History type for that custom object.

I read in an article that - 
" The history reports provide this functionality - if you enable field tracking for a standard/custom object (e.g. Case) 
then when you create a report you can choose the type 'Case History'. This will show who made the edit, when the edit was 
made, the name of the field and its old and new value. "

It does not give me an option to choose the history type for my custom object.
Please help.

Regards,
Darshan.