0

I'm trying to implement a QuickAction that executes when a user hits the "Send an Email" button on a Case. Link to documentation here.

When I copy & paste the implementation code, how is this class executed when I hit the "Send an Email" button? I've put multiple System.debug statements in my class and when I go to the developer console nothing shows up in my log. It appears the code isn't firing at all.

0

You'll need to have Visualforce debugging enabled in order to see your QuickAction execute from your Visualforce page since that's where it's called from, not from an Apex Controller. Sending an Email is actually a form of DML. I'd look for DML execution in your debug logs.

If you really want to see the results of your QuickAction, I suggest you look at the methods in the QuickActionResult Class. With it, you'll be able to use methods like getErrors(), getSuccessMessage() and isSuccess() which you'll see in your Visualforce debug logs.

The link you've provided is to the Defaults Handler Interface. All it does is set default values for an instance of a Standard Quick Action that you're essentially "customizing" to suit your specific requirements. You're not really creating a "new class of quick actions". Instead, it's an instance of the SendAnEmail Action. I'd generally only expect to see where the QuickAction is called on the page and depending on your debug settings, you may not see your class' debug statements appear at all. A unit test is where I'd expect you to be able to easily see your debug statements executed.

4
  • I noticed in the link I provided, the docs say it applies to the "default values for the standard Email Action on Case Feed." Would you know where to manipulate the standard Email Action that does NOT involve Case Feed? – Tyler Zika May 16 '16 at 20:01
  • That would be the SendEmailQuickActionDefaults Class. – crmprogdev May 16 '16 at 20:18
  • But on those docs it says "You cannot instantiate this class. One can use the getters/setters when using it in the context of QuickAction.QuickActionDefaultsHandler." Doesn't that mean that class still rely on the QuickActionDefaultsHandler, which still only applies to the Email Action on the Case Feed? – Tyler Zika May 16 '16 at 20:24
  • Also there is no setter for the From email field, only a getter. I want to set the From email field to a specific email by default – Tyler Zika May 16 '16 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.