• Daniel Garus 10
  • NEWBIE
  • 0 Points
  • Member since 2017

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

I have a class that is called by either a trigger or a scheduled class.

If it crashes I want to add an error to the record which of course does not work if it runs in the schedule, so I added a try catch block to handle the exception.
 
try {            
    pr.addError(Label.FOO);
}
catch (System.FinalException ex) {
    System.debug('Not in Trigger Context');
}
catch (Exception ex) {
    System.debug('Not in Trigger Context ' + ex.getMessage());
}



but it does not seem to catch it, it crashes and sends me an e-mail
 
Apex script unhandled exception by user/organization:

Scheduled job 'foo_bar' threw unhandled exception.

caused by: System.FinalException: SObject row does not allow errors



I do not understand why this sends an email instead of silently going over it.

 
Hi,

I have a class that is called by either a trigger or a scheduled class.

If it crashes I want to add an error to the record which of course does not work if it runs in the schedule, so I added a try catch block to handle the exception.
 
try {            
    pr.addError(Label.FOO);
}
catch (System.FinalException ex) {
    System.debug('Not in Trigger Context');
}
catch (Exception ex) {
    System.debug('Not in Trigger Context ' + ex.getMessage());
}



but it does not seem to catch it, it crashes and sends me an e-mail
 
Apex script unhandled exception by user/organization:

Scheduled job 'foo_bar' threw unhandled exception.

caused by: System.FinalException: SObject row does not allow errors



I do not understand why this sends an email instead of silently going over it.

 

Hi All,

 

I had a REST API integration working on both my Dev instance and client's Enterprise one until today. Client is complaining that it stopped working for them. I've checked both instances and they both have the same issue: when trying to refresh token I'm getting:

 

{"error":"invalid_client_id","error_description":"client identifier invalid"} 

 

None of the code changed since it was confirmed working and definately the Client ID / Consumer Key did not change.

 

Any idea anyone?

Any thoughts or suggestions will be appreciated.

Hi,
I am calling an API and in respose it returns me JSON data. In this i am abstracting a field value which is in ISO format : 2013-12-14T09:49:25-05:00

I need to store this value on an SFDC Object record. please let me know the formating for this.

I am doing this (DateTime.valueOf(responseMap.get('last_reported_at'))).format('YYYY-MM-DDThh:mm:ss-hh:mm') .

Let me know ulternate for this. It will be good if we can do using DateTime format method of salesforce.

I am getting this error : Invalid date/time: 2014-08-25T15:18:41.938Z