function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Preethi77Preethi77 

Email Template

Error: Invalid child of messaging:emailTemplate. Only messaging components are allowed as children of messaging:emailTemplate. 

 

I cannot use messaging attachment tag inside of apex repeat...I want dynamically iterate..

Please help for me.....

 

<apex:component access="global" controller="InvoicePdfControllerAttachment" allowDML="true" >

<apex:attribute access="global" assignTo="{!accountId}" name="BookingAccountId" type="String" required="true" description="Account Id"/>
<apex:attribute access="global" assignTo="{!bookId}" name="BookingId" type="String" required="true" description="Booking Id"/>


<apex:repeat value="{!bookList}" var="a">
<messaging:attachment renderAs="PDF" filename="Test">
</messaging:attachment>
</apex:repeat>

</apex:component>

Ashish_SFDCAshish_SFDC
Hi Preethi, 


This is because you are trying to use <messaging:attachment> inside the repeat tag in the component. this is not allowed.

See more information in the thread below, 

http://salesforce.stackexchange.com/questions/12899/using-a-component-to-add-attachments-to-visualforce-email-template-and-showing-e


Regards,
Ashish