Skip to main content

Hello Everyone


I stumbled across a squite painful problem.

I built a skuidpage which calls a apex to send mails upon buttonclick. It all works perfectly fine in Sandbox, but we pushed it to a live org and it just plain out fails


i get this error in the console:



the Apex looks as follows:


public class SendMailsToParticipants{ 
@InvocableMethod
static void SendMails(List<string> emails) {

static void SendMails(List emails) {


    String eventId = recipients[0];
Event e = [SELECT id FROM Event WHERE id = :eventId];

recipients.remove(0);

List<messaging.singleemailmessage> mailList = new List<messaging.singleemailmessage>();

for(String recipient : recipients){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();mail.setTemplateId([select id from EmailTemplate where developername='EventUpdatedEmail'].id);mail.setTargetObjectId([SELECT id FROM User WHERE id = :recipient].id);mail.saveAsActivity = false;mail.setWhatId(e.id);mailList.add(mail);
}

Messaging.sendEmail(mailList);
}

} String recipients = emails.get(0).split(‘,’);</messaging.singleemailmessage></messaging.singleemailmessage>


i can’t figure out why its failing, the users have rights and i use the exat same data to test on live as on sandbox


Any ideas?

Matti

Try and reduce your URL to just /apex/SendMailsToParticipants



Thanks for the Idea Gregg, Unfortunely i can’t alter the URL path. I call it as “Run Custom Apex Action”.Therefore the URL gets built automatic



Hi Matti

Log into the production Org and paste this into the URL: 
https://workbench.developerforce.com/login.php

This will tell you what you are getting.

It may be a compile error relating to that only top-level class methods can be declared static.

Try that and let me know.


Do Users in Production have access on their Profile / via assigned Permission Sets to your SendMailsToParticipants Apex Class?


Any update on this I have the same issue?


Reply