1

I'm creating a VF email and for some reason my Project Task Name isn't rendering when I test and merge. I have verified that there is a Name that is populated on the record.

Here is my test/merge image: enter image description here

And here is my code:

<messaging:emailTemplate subject="Brand Studio Project Created" recipientType="User" relatedToType="AcctSeed__Project__c">
<messaging:htmlEmailBody > 
    <html>
        <body>
            <STYLE type="text/css">
                TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center } 
                TD  {font-size: 11px; font-face: verdana } 
                TABLE {border: solid #CCCCCC; border-width: 1}
                TR {border: solid #CCCCCC; border-width: 1}
            </STYLE>
        <font face="arial" size="2">
                    <p>Hi {!$User.FirstName}, </p>
                    <p>Below are the Brand Studio product(s) related to {!relatedTo.Client_Name__r.Name}'s campaign. </p>
                        <table border = "0">
                                <tr>
                                <th> Project Task Name </th>
                                <th> Product Name </th>
                                <th> Start Date </th>
                                </tr>
                        <apex:repeat var="pt" value="{!relatedTo.AcctSeed__Project_Tasks__r}">
                                <tr>
                                <td> <apexoutputtext value = "{!pt.Name}" rendered="{!pt.Brand_Studio_Product__c}"/></td>
                                <td> <apex:outputtext value="{!pt.Product__r.Name}"/></td>
                                <td> <apex:outputText value="{0, date, MM-dd-yyy}"> <apex:Param value="{!pt.AcctSeed__Start_Date__c}"/> </apex:outputText> </td>
                                </tr>
                        </apex:repeat>
                    <p>Click on the link to access the record and comment with JIRA key(s) for Brand Studio products: <apex:outputlink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.Id}">{!relatedTo.Name}</apex:outputlink></p>
                        </table>  
            </font>  
        </body>
    </html>
</messaging:htmlEmailBody> 

It's specifically:

                                <tr>
                                <th> Project Task Name </th>
                                <th> Product Name </th>
                                <th> Start Date </th>
                                </tr>
                        <apex:repeat var="pt" value="{!relatedTo.AcctSeed__Project_Tasks__r}">
                                <tr>
                                <td> <apexoutputtext value = "{!pt.Name}" rendered="{!pt.Brand_Studio_Product__c}"/></td>
                                <td> <apex:outputtext value="{!pt.Product__r.Name}"/></td>
                                <td> <apex:outputText value="{0, date, MM-dd-yyy}"> <apex:Param value="{!pt.AcctSeed__Start_Date__c}"/> </apex:outputText> </td>

That is giving me trouble.

Any tips/ideas would be appreciated!

Edit:
More photos to show context.

Field Level Security enter image description here Record I was testing on

6
  • do you, as running user, have FLS on the {!relatedTo.Client_Name__r.Name} field or the {!relatedTo.Client_Name__c} field?. Does your test object that you are previewing have that relationship populated?
    – cropredy
    Oct 10, 2018 at 21:43
  • 1
    I'm assuming Brand_Studio_Product__c is true. Can you confirm that? Oct 11, 2018 at 0:43
  • @ShaneSteinfeld: Yes Brand Studio Product is true!
    – Cynthia
    Oct 11, 2018 at 13:23
  • @cropredy I'm a SysAdmin so yes, I have visbility for all those fields and yes, the test object has the field populated.
    – Cynthia
    Oct 11, 2018 at 13:23
  • Sometimes, during a deployment, the profiles don’t get copied (user error) and in the target org, even sysads lose FLS
    – cropredy
    Oct 11, 2018 at 13:26

0

You must log in to answer this question.

Browse other questions tagged .