3

The following code is working for me in Winter '17 but not Spring '17:

global class EmailPublisherLoader implements QuickAction.QuickActionDefaultsHandler {
// Empty constructor
global EmailPublisherLoader() {
}

// The main interface method
global void onInitDefaults(QuickAction.QuickActionDefaults[] defaults) {
    QuickAction.SendEmailQuickActionDefaults sendEmailDefaults = null;

    // Check if the quick action is the standard Case Feed send email action
    for (Integer j = 0; j < defaults.size(); j++) {
        if (defaults.get(j) instanceof QuickAction.SendEmailQuickActionDefaults && 
            defaults.get(j).getTargetSObject().getSObjectType() == EmailMessage.sObjectType && 
            defaults.get(j).getActionName().equals('Case.Email') && defaults.get(j).getActionType().equals('Email')) {
               sendEmailDefaults = (QuickAction.SendEmailQuickActionDefaults)defaults.get(j);
               break;
        }
    }

    if (sendEmailDefaults != null) {

        EmailMessage emailMessage = (EmailMessage)sendEmailDefaults.getTargetSObject();
            emailMessage.BccAddress = null;
      }     
    }
}

Any ideas why?

5
  • 2
    Are you getting an error message? Or is the action failing silently?
    – SFDC Neuf
    Jan 31, 2017 at 23:09
  • It's failing silently. Jan 31, 2017 at 23:13
  • 2
    Have you inserted debug statements to identify which piece is failing?
    – SFDC Neuf
    Jan 31, 2017 at 23:15
  • Debug statements are failing silently, too. Jan 31, 2017 at 23:16
  • 1
    If that's the case it sounds like you're never entering this code block at all - could it be a config issue?
    – SFDC Neuf
    Jan 31, 2017 at 23:17

1 Answer 1

3

Thank you, @SFDC Neuf! This was the problem:

enter image description here

2
  • 1
    I'm curious, was this related to the upgrade to Spring '17?
    – SFDC Neuf
    Jan 31, 2017 at 23:28
  • Nope, I just forgot that I hadn't configured or tested this functionality in this sandbox before. Jan 31, 2017 at 23:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .