• BdavisBOKF
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 4
    Replies

I have a trigger that is updating a field to track the last event date.   This code currently works in Summer 12 and worked last week in Winter 13.We only have basic support so the help desk was not helpful.  This is in spite of the fact that this is clearly a Winter 13 release issue.

 

Next post has the debug log.

 

 

trigger EventInsertUpdate on Event (before insert, before update, after insert, after update, after delete) {

     if(! trigger.isDelete && trigger.IsBefore){
        for(Event e : Trigger.new) {
            // If the Event Type (Reporting) field does not contain
            // the picklist value of the field Type, populate it with that 
            // picklist value from Type.        
            
            if(e.Event_Type_Reporting__c != e.Type && Trigger.IsBefore) {   
                e.Event_Type_Reporting__c = e.Type;
            }
        }
     }
    // Before triggers can just get out.  The rest is after only.
    if(trigger.IsBefore) return;
    // Put account ids for deleted records in array.
    List <Id> acctsIDList = new List<Id>();
    if(trigger.isDelete){
       
        for(Event e : Trigger.old){
         System.Debug('This is the event in delete' + [Select AccountID, ID, ActivityDateTime From Event Where ID = :e.ID ALL ROWS]);
            if(e.AccountId != null){
                acctsIDList.add(e.AccountId);
            }
        }   
    } else {
        for(Event e : Trigger.new){
            if(e.AccountId != null){
                acctsIDList.add(e.AccountId);
            }
        }
    }
    System.Debug('The acctsIDList size is:' + acctsIDList.size());
    if(acctsIDList.isEmpty()) return;       
    // Now update the LastEventDate for all accounts if necessary
    Map<Id, Account> acctsMap = new Map<Id, Account>([SELECT Id, OwnerId, LastEventDate__c,
                                                            Owner_Last_Activity_Date__c
                                                        FROM Account 
                                                        WHERE Id in :acctsIdList]);
    
    System.Debug('The acctsMap size is:' + acctsMap.size());
    if(acctsMap.values().size() > 0) AccountUtil.UpdateActivityDates(acctsMap);
}

 

 

 

I have a trigger that is updating a field to track the last event date.   This code currently works in Summer 12 and worked last week in Winter 13.We only have basic support so the help desk was not helpful.  This is in spite of the fact that this is clearly a Winter 13 release issue.

 

Next post has the debug log.

 

 

trigger EventInsertUpdate on Event (before insert, before update, after insert, after update, after delete) {

     if(! trigger.isDelete && trigger.IsBefore){
        for(Event e : Trigger.new) {
            // If the Event Type (Reporting) field does not contain
            // the picklist value of the field Type, populate it with that 
            // picklist value from Type.        
            
            if(e.Event_Type_Reporting__c != e.Type && Trigger.IsBefore) {   
                e.Event_Type_Reporting__c = e.Type;
            }
        }
     }
    // Before triggers can just get out.  The rest is after only.
    if(trigger.IsBefore) return;
    // Put account ids for deleted records in array.
    List <Id> acctsIDList = new List<Id>();
    if(trigger.isDelete){
       
        for(Event e : Trigger.old){
         System.Debug('This is the event in delete' + [Select AccountID, ID, ActivityDateTime From Event Where ID = :e.ID ALL ROWS]);
            if(e.AccountId != null){
                acctsIDList.add(e.AccountId);
            }
        }   
    } else {
        for(Event e : Trigger.new){
            if(e.AccountId != null){
                acctsIDList.add(e.AccountId);
            }
        }
    }
    System.Debug('The acctsIDList size is:' + acctsIDList.size());
    if(acctsIDList.isEmpty()) return;       
    // Now update the LastEventDate for all accounts if necessary
    Map<Id, Account> acctsMap = new Map<Id, Account>([SELECT Id, OwnerId, LastEventDate__c,
                                                            Owner_Last_Activity_Date__c
                                                        FROM Account 
                                                        WHERE Id in :acctsIdList]);
    
    System.Debug('The acctsMap size is:' + acctsMap.size());
    if(acctsMap.values().size() > 0) AccountUtil.UpdateActivityDates(acctsMap);
}

 

 

 

Hi,

 

I have done some triggers in my sandbox isntance; when i tried to deploy these triggers from Sandbox to Production, I got the error that the Api version in my Production Org is 22.0, this is because my sandbox is on Winter 12 and Production is still in Summer 11,  this will be solved this weekend

:))

 

My question is......I have tried also to do it with Eclipse, and it saids that my version is 20.0

 

How can up upgrade to 23.0?

Thanks!!!

  • October 11, 2011
  • Like
  • 0

Hi,

 

Does anybody know in which table are stored the users requests to join private groups in Chatter?

 

I have seen the "CollaborationGroup", "CollaborationGroupMember" and "CollaborationInvitation" tables but no way to find something like "CollaborationGroupMemberRequest".

 

Thanks.

As an administrator, how do I get a list of all the reports that are scheduled to be run and emailed to diff users?

I need, report name, schedule time and user being emailed to.

Please help. Thank you

-Vj