• j_r_ro
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 8
    Replies

Hi all,

I have a piece of code that was previously working up until winter14. I am trying to add a Message to ApexPage messages, where the message reports that a salesforce field could not be updated.

Note Salesforce is also adding their own exception to the page messages so the expected output is 2 error messages - 1 with the custom message, the other with the salesforce message.

 

this is the exception, which is caught and added to page messages:

 

throw new COMMON_EX_Exceptions.DocumentGenerationException('Document delivery has succeeded but post generation field update has failed for document setting: "' +docSettingList[0].Name +
+'". Contact your administrator to review this message and resolve the issue.\nError message: ' + e.getMessage());

 

where e.getMessage is 'Update failed. First exception on row 0 with id 003E000000eegPUIAY; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Required test]: [Required test]'.

 

The second error message (reported by salesforce) is just the string "Required fields are missing: [Required test]".

 

Our custom message is not being added to page messages, where the salesforce one is still working correctly. If I alter the error message so the matching portions of the strings are different, it works and reports both messages.

 

Is anyone aware of any changes in 14 that would cause any message containing some duplicate string to only be added to page messages once?

 

Thanks.

 

  • November 26, 2013
  • Like
  • 0

I am trying to display a custom exception to the user, using ApexPages.addMessage(msg) and display it in an apex:pageMessages block.

 

I am adding this message like this:

ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, message);
System.debug('My message: ' + myMsg);

ApexPages.addMessage(myMsg);

System.debug('Exception handler messages: ' + ApexPages.getMessages());

 

 

In the first debug statement, the error is logged as expected:

ApexPages.Message["Custom exception message.
Error message: Update failed. First exception on row 0 with id; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Required test]: [Required test]"]

 

However, when I log out the messages list, only the 'REQUIRED_FIELD_MIssing error is logged, and dislpayed on the page.

 

When I debug the ApexPages.getMessages() BEFORE and AFTER calling addMessage(custom message), the messages list only contains the Salesforce-generated message.

The custom message has not been added.

 

 

 

  • October 21, 2013
  • Like
  • 0

Hi all,

 

I am trying to perform a DML operation in a method that is called by the page controller constructor.

I know DML is not allowed in the constructor - is it also not allowed in any methods called by the constructor?

 

Since I am using an apex page, I can't use the 'allowDml' attribute. The other possible solution I found was to use an action on the page.

My page already has an action - can I have multiple actions on the page, or only one?

 

Are there any other ways to get around this?

 

Thanks.

  • August 28, 2013
  • Like
  • 0

Hi all,

 

Could someone explain what the difference is (if there is any) between creating a new sandbox, and refreshing an existing sandbox? With regards to the resulting state of the sandbox. I haven't managed to find any information about this.

Mainly, I would like to know what happens to any data/apps in the sandbox after the refresh? E.g. are they all maintained, or deleted on refresh?

 

Thanks.

We have been hitting the single email limit on an almost daily basis in a Developer Edition org.

 

I have checked the email logs and from the last day, there have only been 30 emails sent. There are also no jobs listed under apex jobs in Setup that could be calling sendEmail.

 

Is there a way to find out where this has been called, or what emails are sent that are causing the limit to be hit?

 

In this document http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm the numebr of sendEmail methods is listed as 10 but as far as I was aware, we are allowed to send 1000 emails per day.

Are the limits different in developer orgs? Or could having >10 sendEmail methods also be causing this exception?

I am trying to display a custom exception to the user, using ApexPages.addMessage(msg) and display it in an apex:pageMessages block.

 

I am adding this message like this:

ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, message);
System.debug('My message: ' + myMsg);

ApexPages.addMessage(myMsg);

System.debug('Exception handler messages: ' + ApexPages.getMessages());

 

 

In the first debug statement, the error is logged as expected:

ApexPages.Message["Custom exception message.
Error message: Update failed. First exception on row 0 with id; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Required test]: [Required test]"]

 

However, when I log out the messages list, only the 'REQUIRED_FIELD_MIssing error is logged, and dislpayed on the page.

 

When I debug the ApexPages.getMessages() BEFORE and AFTER calling addMessage(custom message), the messages list only contains the Salesforce-generated message.

The custom message has not been added.

 

 

 

  • October 21, 2013
  • Like
  • 0

We have been hitting the single email limit on an almost daily basis in a Developer Edition org.

 

I have checked the email logs and from the last day, there have only been 30 emails sent. There are also no jobs listed under apex jobs in Setup that could be calling sendEmail.

 

Is there a way to find out where this has been called, or what emails are sent that are causing the limit to be hit?

 

In this document http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm the numebr of sendEmail methods is listed as 10 but as far as I was aware, we are allowed to send 1000 emails per day.

Are the limits different in developer orgs? Or could having >10 sendEmail methods also be causing this exception?