• Joe Antonecchia
  • NEWBIE
  • 5 Points
  • Member since 2015

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

Hi,
I have an after update trigger on the User object.  If the Active checkbox is checked/unchecked, the trigger does not fire.   Any thoughts/ideas on what is happening?  I have seen mixed comments in threads where it seems to work for some people but it isnt working for me.

Thanks

I have created a VF page as follows in order to bypass the Recent page and go directly to a List View:
<apex:page tabStyle="Outbound_Messages__tab" action="{!URLFOR($Action.psp_out_message__c.List, $ObjectType.psp_out_message__c)}" />
I have a VF tab named "Outbound_Massages" referencing this page.  It is working except the tab does not highlight when clicked.   Any ideas how to fix this?

Thanks for any help.
Hi Everyone and thanks for taking the time to review my issue,
I'm writing my first Scheduled Apex class that will do some processing on updated and deleted rows.  I schedule the class to run as a job it errors.  If I copy the code (minus the reschedule code at the bottom) and run it in developer console it works.  When it runs as a job it errors with the following error in the log:

11:39:25.042 (42229387)|EXCEPTION_THROWN|[5]|System.UnexpectedException: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 912151193-21775 (1909173740)
11:39:25.042 (42308796)|HEAP_ALLOCATE|[5]|Bytes:133
11:39:25.042 (42419133)|FATAL_ERROR|System.UnexpectedException: UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 912151193-21775 (1909173740)

Class.PSPMultioutput.execute: line 5, column 1


Here is the code:

global class PSPMultioutput implements Schedulable {
   global void execute(SchedulableContext SC) {
           try {
               String tablename = 'Account';
              Database.GetUpdatedResult r = Database.getUpdated(tablename, Datetime.now().addMinutes(-2), Datetime.now());
              List<Id> updatedIdList = r.getIds();
            // sObject types to describe
            String[] types = new String[]{tablename};
            // Make the describe call
            Schema.DescribeSobjectResult[] results = Schema.describeSObjects(types);

            DescribeSObjectResult res = results[0];
            List<String> fields = new List<String>(res.fields.getMap().keySet());
            String qry = 'Select ' + String.join(fields, ',') + ' from ' + tablename;


            for (Account acct : Database.query(qry)){
                    String name = acct.name;
                    System.debug('Account: ' + name);
            }
            System.debug('Query succesfully executed.');
        } catch (Exception ce) {
            System.debug('\nFailed to execute query successfully, error message ' +
                'was: \n' + ce.getMessage());
        }

        //schedule next execution after a minute
        DateTime currentDateTime=System.now().addMinutes(1);                            
        String nextScheduleTime=String.valueof(currentDateTime.second()) +' '+String.valueof(currentDateTime.minute())+' '
                                +String.valueof(currentDateTime.hour())+' '+String.valueof(currentDateTime.day())+' '
                                +String.valueof(currentDateTime.month())+' ? '+String.valueof(currentDateTime.Year());
        
        PSPMultioutput testObj = new PSPMultioutput();
        
        system.schedule('Scheduled at '+System.now().format(), nextScheduleTime, testObj);
        
        for( CronTrigger cronTriggerItem:[Select Id From CronTrigger where  
                                    NextFireTime= null  AND State='DELETED' Limit 100])
        {
                System.abortJob(cronTriggerItem.id);
        }       
   }   
}

Hi,
I have an after update trigger on the User object.  If the Active checkbox is checked/unchecked, the trigger does not fire.   Any thoughts/ideas on what is happening?  I have seen mixed comments in threads where it seems to work for some people but it isnt working for me.

Thanks