• Tom Hoban.ax728
  • NEWBIE
  • 25 Points
  • Member since 2010

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

We have a managed package that includes a Visual Force Custom Component that is accessed from a Visual Force Email Template.  We have no problem accessing the component from a packaged VF Email Template.  However, post install, I don't know how to  create a new VF Email Template that can reference the packaged VF Custom Component. 

 

 We get this error:

 

   Error: Component c:ourCustomComponent does not exist

 

 

Our VF Email template looks like this:

 

 

<messaging:emailTemplate subject="Past Due Balance" recipientType="Contact" relatedToType="ournamespace__OurCustomObject__c">
  <messaging:htmlEmailBody >
     <br/><apex:image value="{!relatedTo.ournamespace__our_field1__c}" />
     <br/><br/><br/>Dear {!recipient.firstName}:

     <br/><br/>This is to inform you that you owe: <apex:outputfield value="{!relatedTo.ournamespace__our_field2__c}"/>

  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:ourCustomComponet ourId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

I saw another posting related to using a packaged custom component inside of a Visual Force page that suggested replacing the "c:" with "namespace:" in front of the component name, but this does not work.  Generates this error:

 

Error: Unknown component ournamespace:ourCustomComponent

 

Surely, there must be a way to use a packaged component from an email template.  Has anyone enountered this problem and know of a good solution? 

 

Thanks,

Tom

 

 

Can you send email using a Visual Force Email template from a Apex Batch class (implements Database.Batchable...)? 

 

When I try, I get:

 

caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null: []

 

Running the same code from a Visual Force page, rather than a batch job, runs fine.

I have a visual force email template that uses a component to place an attachment into an email.  I also have code in my application that transitions to the the EmailAuthor.jsp page using a url that looks like this:

 

https://na7.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=a0bA0000000A6slIAC&template_id=00XA0000000OHXmMAO

 

As you can see, I am providing a whatId and a template id.

 

When I arrive at the EmailAuthor page, at first glance everything looks good.  I see text from my template in the body and I see data from my relatedTo record properly merged into the email.  Unfortunately though, the attachment does not appear.  If I then click on the button to "select a template" and then choose the template that was provided in the above url, the page refreshes and the attachement is now shown on the page.  Of course, the whole reason why I provided the template id in the url was so the user doesn't have to select it.

 

Has anyone encountered this problem before and found a way to resolve it?

 

My template looks like:

 

<messaging:emailTemplate subject="Past Due Balancexx" recipientType="Contact" relatedToType="DunningNoticeQueue__c">
  <messaging:htmlEmailBody >
     <br><apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
     <br><br><br>Dear {!recipient.firstName}:

     <br><br>This is to inform you that you owe: {!relatedTo.AR_Summary_Unworked__r.Total_AR_Balance__c}
     <br><!apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:DunningInvoiceAttachment dunningQueueId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

 

We have a managed package that includes a Visual Force Custom Component that is accessed from a Visual Force Email Template.  We have no problem accessing the component from a packaged VF Email Template.  However, post install, I don't know how to  create a new VF Email Template that can reference the packaged VF Custom Component. 

 

 We get this error:

 

   Error: Component c:ourCustomComponent does not exist

 

 

Our VF Email template looks like this:

 

 

<messaging:emailTemplate subject="Past Due Balance" recipientType="Contact" relatedToType="ournamespace__OurCustomObject__c">
  <messaging:htmlEmailBody >
     <br/><apex:image value="{!relatedTo.ournamespace__our_field1__c}" />
     <br/><br/><br/>Dear {!recipient.firstName}:

     <br/><br/>This is to inform you that you owe: <apex:outputfield value="{!relatedTo.ournamespace__our_field2__c}"/>

  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:ourCustomComponet ourId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

I saw another posting related to using a packaged custom component inside of a Visual Force page that suggested replacing the "c:" with "namespace:" in front of the component name, but this does not work.  Generates this error:

 

Error: Unknown component ournamespace:ourCustomComponent

 

Surely, there must be a way to use a packaged component from an email template.  Has anyone enountered this problem and know of a good solution? 

 

Thanks,

Tom

 

 

I have a visual force email template that uses a component to place an attachment into an email.  I also have code in my application that transitions to the the EmailAuthor.jsp page using a url that looks like this:

 

https://na7.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid=a0bA0000000A6slIAC&template_id=00XA0000000OHXmMAO

 

As you can see, I am providing a whatId and a template id.

 

When I arrive at the EmailAuthor page, at first glance everything looks good.  I see text from my template in the body and I see data from my relatedTo record properly merged into the email.  Unfortunately though, the attachment does not appear.  If I then click on the button to "select a template" and then choose the template that was provided in the above url, the page refreshes and the attachement is now shown on the page.  Of course, the whole reason why I provided the template id in the url was so the user doesn't have to select it.

 

Has anyone encountered this problem before and found a way to resolve it?

 

My template looks like:

 

<messaging:emailTemplate subject="Past Due Balancexx" recipientType="Contact" relatedToType="DunningNoticeQueue__c">
  <messaging:htmlEmailBody >
     <br><apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
     <br><br><br>Dear {!recipient.firstName}:

     <br><br>This is to inform you that you owe: {!relatedTo.AR_Summary_Unworked__r.Total_AR_Balance__c}
     <br><!apex:image value="{!relatedTo.Image_1_Web_Address__c}" />
  </messaging:htmlEmailBody>
  <messaging:attachment renderAs="application/vnd.ms-excel" filename="invoices" >  
     <c:DunningInvoiceAttachment dunningQueueId="{!relatedTo.Id}"/>  
  </messaging:attachment>
</messaging:emailTemplate>

 

 

I have a trigger that sends an email using a Visual Force Email template to a contact when an Opportunity stage changes to a couple specific values and the type of transaction (custom field) is set to a couple of specific values.  There is a text field on the opportunity that holds an email address that this email is to be sent to.  A query using this text field determines if a contact exists with this email or if it does not exists, creates a dummy contact.  The existing contact or dummy contact is the recipient.  A "Send Test and Verify Merge Fields" on the template works fine.  The Trigger won't deploy and here is the debug code.

 

mail=Messaging.SingleEmailMessage[
getBccAddresses=null;
getCcAddresses=null;
getCharset=null;
getDocumentAttachments=null;
getFileAttachments=null;
getHtmlBody=null;
getPlainTextBody=null;
getTargetObjectId=0037000000lx8iHAAQ;
getTemplateId=00X700000016C9gEAE;
getToAddresses=null;
getWhatId=0067000000IkfgVAAR;
isUserMail=false;]

 

21:11:27.566|METHOD_ENTRY|[77,4]|Messaging.sendEmail(LIST:Messaging.SingleEmailMessage)
21:11:27.749|EXCEPTION_THROWN|[77,4]|System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null
21:11:27.751|METHOD_EXIT|[77,4]|sendEmail(LIST:Messaging.Email)
21:11:27.751|FATAL_ERROR|System.EmailException: SendEmail failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException: Argument Error: Parameter value is null

How can I determine what parameter value is null?

Thanks

 

  • June 03, 2010
  • Like
  • 0

Hi in absence of select distinct can somebody please send me the alternative logic for select distinct in sfdc please?

 

I tried the following link but this logic is not working

 

http://developinthecloud.wordpress.com/2009/06/28/soql-distinct-keyword/

  • March 31, 2010
  • Like
  • 0