• ErikOSnet0
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 17
    Replies

Hi,

 

From New Spring '10 Apex Dev Guide: 

"Single email messages sent with the sendEmail method count against the sending organization's daily single email limit. When this limit is reached, calls to the sendEmail method using SingleEmailMessage are rejected, and the user receives a SINGLE_EMAIL_LIMIT_EXCEEDED error code. However, single emails sent through the application are allowed."

 

 

  1. If I select a User as the setTargetObjectId does it still count against these limits?
  2. What is the actual daily max # of single emails by org type?

 

Thanks in advance for you help,

Mike 

Is there any way to add an error to an record being updated in a trigger and send an email. The trigger needs to send an email (one per batch). The email works fine if the processing generates no errors and I do not use the addError method. If I use the addError method to pass a message back to the user then the email is not sent.

 

So is there a way to send an email and use addError in the same trigger code? If not is there another mechanism that can be used to pass a message back to the user interface (standard salesforce UI).

 

Thanks

 

Dave

Does Apex support reflection

 

I have a class that does a lot of parsing and, based on the results, invokes different classes that support an interface.  Of course, in order to instantiate the class, it has to create a compile time dependency on the class, which also can create a dependency on custom objects and fields.  

 

Now that I want to reuse and extend this for another project that will be deployed to a different SFDC instance, all these dependencies become an issue, because those custom fields and objects are not in the other SFDC instance.  

 

On top of this, I want it to all become completely configurable with the parsing and invoking to be part of a re-usable framework.  I want to declare which classes to instantiate based on the data being parsed to be configurable (runtime configurable object factory).  

 

This is a common use case for reflection.  Can I do this in SFDC?  Or, are we doomed to not be able to use reusable configurable code?

 

In Eclipse, I right click on a Force.com project and select Force.com's Deploy to Server... option.  It pops up an exception saying "Unable to deploy - no deployable resources found."

 

How do you resolve this? 

 

I have an input field that is appearing too small, making it hard for the user to read its contents (text up to 100 characters). 

 

I'd like to have it span the width of the form, but no matter what, it still only appears in column 1 of 2.  Here is what I tried to no avail:

 

<apex:pageBlockSection title="Email Contents" columns="1"> <apex:inputField value="{!notification.EmailTemplateName__c}"/> </apex:pageBlockSection>

 

You would have thought that columns="1" would have done it.  

 

How do I get this field (including the label) to span the width of the page block section or form instead of leaving the right half blank?  

 

 

Currently the finish() method is not called if the query returns no records. I think this is wrong. I think finish() should always be called regardless whether the query returns any records or not. What do you think?

I understand the purpose of the governor limits.  I understand some of the limits themselves, such as heap size.  I do not understand many of them.  One I do not understand is a limit of 1000 for a List. It appears to be an indirect memory limit, which is a duplicate effort since there is already a heap limit, and counterintuitive since one element can be as small as an Integer or as large as a complex blob containing object. 

 

THE QUESTION:  If I need to insert 1600 rows, does this actually mean I have to create two lists, one with 1000 and another with 600 rows, which I then have to execute as two inserts?  Am I understanding this correctly?!?

 

Can we assume anything about the order in which Batch Apex jobs are executed?

 

Imagine a user clicks a button that launches a Batch Apex job that will process 5000 records, in chunks of 500. While this Batch Apex job is chugging away, the user clicks another button that launches a different Batch Apex job that will process 2000 records, 100 per chunk. Can I be certain that all of the chunks for the first job will complete (all of the records will be processed) before the second job's first chunk begins? 

 

Thanks!

I have a process that sends emails to the Contacts of a set of Accounts (customer notification).  To do this, I create the message for each Account, as it is customized for the Account.  Because of the governer limit of 10 on invoking email send, I accumulate these in an array, then send at once. 

 

Unfortunately, if any of the emails are on a bounce list, then it fails to send any of them.  At any given time you are likely to one or more customer emails bounce, so this is very impractical.  Moreover, although I notify the requester of the exception, it does not include the email address that bounced, so is hard for an end-user to remedy:

 

First exception on row 1; first error: INVALID_EMAIL_ADDRESS, email address has bounced for id : 0037000000RqE7e: []

 

Even if I parse and discover the email address of the contact, there are reasons why an end-user cannot necessarily correct the situation, such as the customer's email server is temporarily unavailable.  

 

How does this conflict with the governer guidelines?  If there wasn't a limit of 10 send requests per HTTP request, I'd send each email individually, permitting all the others to successfully be sent despite the failure.  

 

I have a process that notifies the Contacts of Accounts that match a query.  I created the ability to run in test mode where it scrubs the email address before sending, adding it to the toAddresses.  That works.  But, this needs to use a template. 

 

The template requires a targetObjectId.  Unfortunately, this uses the real email address of the Contact rather than the scrubbed one. Does anyone know of a way to use a supplied email address rather than the email of the Contact record without changing the underlying value in the database?  

 

 

Does anyone know how to parse a String in a predefined format to a Date? Specifically, I'm trying to convert '1-Apr' to a date.  

 

As a Java developer, I can't believe how much time I am spending reinventing the wheel. Why is there no DateFormat, or SimpleDateFormat class? Why on earth didn't they just use Java like Google Apps does?

 

I can currently able to convert the day and year in Apex, ableit with tedious code.  I tried to convert the month from Apr to 4 using an enum (ordinal() returns position), but there doesn't seem to be a way to convert a String to its Enum counterpart like I can do in Java. In fact, ordinal() doesn't even seem to be compiler friendly, despite being documented (perhaps it is new to Apex 17.)

 

Here is what I have so far, with month obviously hard coded:

 

    /**
     * Dates are in the format of d-Mon in the CSV file.  E.g., "1-May" is the first
     * of may.  The year should put it in the future.  Thus, if it is "1-Jan" and it
     * is currently December of 1009, then the year should be 2010. 
     **/
    public Date convertEffectiveDate(String inDate) {
           String[] dateParts = inDate.split('-');
           Integer day = Integer.valueOf(dateParts[0]);
          
           Integer month = 4;
           Date effective = Date.newInstance(Date.today().year(), month, day);
          
           if (effective < Date.today())
               effective.addYears(1);
              
           return effective;
    }

 

 

Hi,

My understanding is that an org can only send 1000 emails per day.

 

If we have a @future method that execute the sendEmail() method:

 

 

@future public void sendEmailInFuture(){ Messaging.sendEmail(); }

 

And we call this method from other classes. When it reaches the limit, would the remaining messages be sent the next day when the limit is reset?

 

Thanks.

 

 

How many emails can the sendEmail  Apex method send out per day?

 

I went through the documentation, and here is what is says:

a. "All mass email and single email messages sent with the sendEmail method count against the daily mass mail limit of the sending organization."

 

b. "You can send mass email to a maximum of 1000 external email addresses per day based on Greenwich Mean Time (GMT)."

 

Statement 'b', in my opinion means that you can send emails to maximum 1000 distinct email addresses per day, but it says nothing about the number of actual email messages being sent.

 

 

Thanks.

"All mass email and single email messages sent with the sendEmail method count against the daily mass mail limit of the sending organization. When the daily mass mail limit for the organization is reached, all calls to the sendEmail method are rejected, and the user receives a MASS_MAIL_LIMIT_EXCEEDED error code" (in the doc)

This renders the Apex outbound email features USELESS !! What's the point of a sendEmail feature if I'm not sure if the email will be sent or not, depending on how much users would have already done some mass email or not?!!

Everyone: vote at http://ideas.salesforce.com/article/show/10087499?page=last#lastPost .