• Jack Davis 3
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies
Hi all, 

I'm trying to create a new visualforce page that can accessed via a custom button to display a list of records. 

I've tried to create the custom object controller using the code below but get three errors. The custom object is called IT Assets. 

API Name: IT_Asset__c
Object Name: IT_Asset

Unknown property 'EmployeeListWithController.IT_Asset__c'
Invalid type: IT_Asset
Illegal conversion from List<IT_Asset__c> to List<IT_Asset>
public class EmployeeListWithController {
private String sortOrder = 'Name';
public List<IT_Asset> getIT_Asset() {
    List<IT_Asset__c> results = Database.query(
        'SELECT Id, Device_Type__c, Device_Model__c, Active__c, LastName' +
        'FROM IT_Asset__c ' +
        'ORDER BY ' + sortOrder + ' ASC ' +
        'LIMIT 10'
    );
    return results;
}
}

I've also written a visualforce page to access the records which is currently blank. I want to display just the active records (checkbox).
<apex:page controller="EmployeeListWithController">
    <apex:form>
        <apex:pageBlock title="Asset List" id="IT_Asset__c">
            <!-- IT_Assets List -->
<apex:pageBlockTable value="{! IT_Asset__c }" var="it">
    <apex:column value="{! it.Name }"/>
    <apex:column value="{! it.Device_Type__c }"/>
    <apex:column value="{! it.Device_Model__c }"/>
    <apex:column value="{! it.Active__c }"/>
</apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Can anyone offer some assistance please?
I'm trying to convert a Chrome HTML page to visualforce email template in Salesforce. I am getting these errors.

Error: Call_Monitoring_Test2 line 60, column 12: Open quote is expected for attribute "class" associated with an element type "div"
Error: Open quote is expected for attribute "class" associated with an element type "div".

Below is the code used. 

Can anyone help
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
<meta name="Generator content"="Microsoft Word 15 (filtered)"></meta>
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin-top:0cm;
	margin-right:0cm;
	margin-bottom:8.0pt;
	margin-left:0cm;
	line-height:107%;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
	{mso-style-link:"Header Char";
	margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
	{mso-style-link:"Footer Char";
	margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.HeaderChar
	{mso-style-name:"Header Char";
	mso-style-link:Header;
	font-family:"Calibri",sans-serif;}
span.FooterChar
	{mso-style-name:"Footer Char";
	mso-style-link:Footer;
	font-family:"Calibri",sans-serif;}
.MsoChpDefault
	{font-family:"Calibri",sans-serif;}
.MsoPapDefault
	{margin-bottom:8.0pt;
	line-height:107%;}
 /* Page Definitions */
 @page WordSection1
	{size:595.3pt 841.9pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
-->
</style>

</head>

<body lang=EN-GB style='word-wrap:break-word'>

<div class=WordSection1>

<p class=MsoNormal style='margin-bottom:0cm'>                                </p>

<p class=MsoNormal style='margin-bottom:0cm'>&nbsp;</p>

<p class=MsoNormal style='margin-bottom:0cm'>                   <b><span
style='font-size:16.0pt;line-height:107%'>Call Quality Feedback</span></b> <b><span
style='font-size:16.0pt;line-height:107%'>Templates</span></b></p>

<p class=MsoNormal style='margin-bottom:0cm'><b><span style='font-size:16.0pt;
line-height:107%'>&nbsp;</span></b></p>

<p class=MsoNormal style='margin-bottom:0cm'><b><span style='font-size:16.0pt;
line-height:107%'>&nbsp;</span></b></p>

<p class=MsoNormal style='margin-bottom:0cm'><span style='font-size:14.0pt;
line-height:107%'>&nbsp;</span></p>

<p class=MsoNormal style='margin-bottom:0cm'><u>Agent Individual Call Pass:</u></p>

<p class=MsoNormal style='margin-bottom:0cm'><u><span style='text-decoration:
 none'>&nbsp;</span></u></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Hello [Agent]</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Well done! We have reviewed your call and you have passed.
The call we listened to was [link to call] from [date of call]. Your scores
were;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Customer Experience:                      %</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Process:                                            %</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Regulation &amp; Compliance:               Pass</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>To help you keep up the good work, please take the time to
review the following key points that we noted during your call:</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>What you are doing really well;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>[text from call monitoring form]</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>Where you can improve even further;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>[text from call monitoring form]</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>&nbsp;</span></i></p>

<p class=MsoNormal style='margin-bottom:0cm'><i><span style='font-size:10.0pt;
line-height:107%'>If you have any questions, or would like some further
information please contact callquality@verexinsurance.co.uk</span></i></p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

<p class=MsoNormal>&nbsp;</p>

</div>

</body>

 
Hi all,

A developer had written an Apex Trigger for us years ago and we're now getting an error. We don't have a developer at the moment due to him having covid19, I was wondering whether anyone here can assist. This is stopping us creating tasks.

This is the error we're getting:
Apex trigger TaskTrigger caused an unexpected exception, contact your administrator: TaskTrigger: System.LimitException: Too many query rows: 50001

Here's the code:
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
MODIFICATION HISTORY

RG  ray@forceclarity.com (email me!)

07/09/2012  RG  created
23/10/2012  RG  enabled OnBeforeInsert for UpdateServiceNameOnOutbounds() 
06/11/2012  RG  enabled AfterInsert and AfterUpdate for calculation of Total Outbound Calls on parent Account
10/12/2014  RG  added Trigger.newMap to before insert and before update  
  
*/

trigger TaskTrigger on Task (after delete, after insert, after undelete, after update, before delete, before insert, before update) {
    
    Task_TriggerHandler handler = new Task_TriggerHandler(Trigger.isExecuting, Trigger.size);
    
    if (Task_TriggerHandler.isExecuteTrigger) {
      
        if(Trigger.isInsert && Trigger.isBefore){
            handler.OnBeforeInsert(Trigger.new, Trigger.newMap);
        } 
        else if(Trigger.isInsert && Trigger.isAfter){
            handler.OnAfterInsert(Trigger.new, Trigger.newMap);
            //TaskTriggerHandler.OnAfterInsertAsync(Trigger.newMap.keySet());
        }
    
        else if(Trigger.isUpdate && Trigger.isBefore){
            handler.OnBeforeUpdate(Trigger.old, Trigger.new, Trigger.newMap);
        }
       
        else if(Trigger.isUpdate && Trigger.isAfter){
            handler.OnAfterUpdate(Trigger.old, Trigger.new, Trigger.newMap);
            //TaskTriggerHandler.OnAfterUpdateAsync(Trigger.newMap.keySet());
        }        
    }
    

}

 
Can someone help. 

I'm trying to remove a section from a visualforce page and keep getting this error. The section to be removed is below. 


Error: LandRoverCalltoAction line 238, column 15: The element type "apex:form" must be terminated by the matching end-tag "</apex:form>"


Error: The element type "apex:form" must be terminated by the matching end-tag "</apex:form>".

 
<div class="form-section">
                            <div class="form-row">
                                <div class="form-field">
                                    <label class="form-field__label" for="searchField">Postcode</label>
                                    <div class="postcode__input">
                                        <div class="form-field__input">
                                            <apex:inputField id="searchField" value="{!Account.Postcode_Hidden__c}" required="true"/>
                                        </div>

                                        <input id="searchButton" class="form-button form-button--primary" type="button"
                                               onclick="findByPostcode()" value="Find" />

                                    </div>

                                    <div id="selectDropdownDiv" class="selectDropdownDiv">
                                        <label class="form-field__label" for="addressListSelect">Please select your address</label>
                                        <select id="addressListSelect" class="addressListSelect"></select>
                                    </div>
                                    <div class="errorDateMsg" id="errorAddrMsg" style="display: none">Please type the postcode and select your address</div>

                                    <div id="form-address" class="form-address">
                                        <output id="output-address1"></output>

                                        <output id="output-town"></output>

                                        <output id="output-postcode"></output>
                                    </div>

                                    <div id="form-address-apex" class="form-address-apex">
                                        <apex:inputField id="form__address_1" required="true" value="{!Account.BillingStreet}"/>
                                        <apex:inputField id="form__city" value="{!Account.BillingCity}"/>
                                        <apex:inputField id="postcode__box" value="{!Account.BillingPostalCode}"/>
                                    </div>
                                    
                                </div>
                            </div>

                        </div>


 
We've built a force.com site and we have the A5 Apps package installed to generate a PDF. Upon completion of a transaction, we want to download the pdf. However I'm getting error messages saying the URL is down or incorrect. 

Below is a sample of the code and was wondering whether some can assist with what the correct URL is?
 
<div class="section section--success" data-accordion="section-4-success" id="section-4-success">
        <div class="section__inner success">
            <div class="section-title section-title--success">YOU’RE COVERED FOR ANOTHER YEAR</div>
            <p class="success__focus">THANK YOU FOR RENEWING YOUR KIA EXCESS RETURN POLICY</p>
            <p class="section-title-success-text">We’ve emailed your certificate of cover. Keep it somewhere safe.</p>
            <div class="success__download">
                <span id="generating" class="btn btn--generating">Please Wait...</span>
                <button class="btn btn--next btn--download-certificate" id="downloadBtn" onclick=" downloadLink()"  href="/servlet/servlet.FileDownload?file=" >
                    <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
                         width="25" height="25"
                         viewBox="0 0 224 224"
                         style=" fill:#000000;">
                        <g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt"
                           stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0"
                           font-family="none" font-weight="none" font-size="none" text-anchor="none"
                           style="mix-blend-mode: normal">
                            <path d="M0,224v-224h224v224z" fill="none"/>
                            <g fill="#cd0025">
                                <g id="surface1">
                                    <path d="M111.02,13.16c-4.62,0.5075 -8.085,4.4625 -7.98,9.1v106.26l-16.1,-16.1c-1.89,-1.9425 -4.5675,-2.9225 -7.28,-2.66c-3.4825,0.3325 -6.4575,2.6775 -7.595,5.985c-1.155,3.325 -0.2625,7 2.275,9.415l37.66,37.66l37.66,-37.66c2.345,-2.24 3.3075,-5.565 2.5025,-8.715c-0.805,-3.1325 -3.2375,-5.6 -6.37,-6.44c-3.1325,-0.84 -6.475,0.0875 -8.7325,2.415l-16.1,16.1v-106.26c0.035,-2.4325 -0.91,-4.76 -2.625,-6.475c-1.715,-1.715 -4.0425,-2.66 -6.475,-2.625c-0.28,-0.0175 -0.56,-0.0175 -0.84,0zM8.96,161.28v25.48c0,6.615 2.0125,13.02 6.72,17.5c4.7075,4.48 11.1825,6.3 17.64,6.3h157.5c6.545,0 13.02,-1.855 17.64,-6.44c4.62,-4.585 6.58,-11.2175 6.58,-17.78v-25.06h-17.92v25.06c0,3.29 -0.7,4.4975 -1.26,5.04c-0.56,0.5425 -1.7325,1.26 -5.04,1.26h-157.5c-3.395,0 -4.6375,-0.7525 -5.18,-1.26c-0.5425,-0.5075 -1.26,-1.365 -1.26,-4.62v-25.48z"/>
                                </g>
                            </g>
                        </g>
                    </svg>
                    <p style="float: right; margin-left: 10px;">DOWNLOAD YOUR CERTIFICATE</p>
                </button>
            </div>

 
Hi, 

I've got a process builder than flows when a record is created or edited. 

I'm trying to find a trigger that can automate the update of records WITHOUT the use of Apex.

Does anyone have any suggestions?
Hi, 

I have built a custom lightning component that's triggered from a button on the event object. To complete the application the user selects 'Done', however, at that point the application hangs and I end up with the blue circle spinning and get the following error: 

This page has an error. You might just need to refresh it. Error in $A.get Callback() [CAn't find variable: sforce] Callback failed: apex://PMA_WizardCtrl/ACTION$setRecordFieldvalue Failing descripto: {c:PMA_Wizard}

Any help troubleshooting is most appreciated. Below is the PMA Wizard code.

"<aura:component controller="PMA_WizardCtrl" description="PMA_Wizard" implements="force:hasRecordId">

    <!-- common assets -->
    <ltng:require styles="{! join(',',
                                $Resource.PMA + '/css/app.css') }"/>
    <!-- /common assets -->

    <!-- component variables -->
    <aura:attribute name="uiTheme" type="String"/>
    <aura:attribute name="recordId" type="String"/>
    <aura:attribute name="accountId" type="String"/>
    <aura:attribute name="userId" type="String"/>
    <aura:attribute name="eventRecordTypeId" type="String"/>
    <aura:attribute name="settings" type="Object"/>
    <aura:attribute name="step" type="String" default="error"/>

    <aura:attribute name="account" type="Account" access="private"/>

    <aura:attribute name="steps" type="List" default="['dealerEmployees', 'dealerInformation', 'trainingInformation', 'alignedBodyshop', 'futureVisits']" access="private"/>

    <aura:attribute name="asyncProcesses" type="Integer" default="0" access="private"/>
    <!-- /component variables -->

    <!-- component handle events -->
    <aura:handler name="init" value="{!this}" action="{!c.handleInitCmp}"/>

    <aura:handler name="onaction" event="c:PMA_Event" action="{!c.handleAction}"/>
    <aura:handler event="force:showToast" action="{!c.handleShowToast}" phase="bubble"/>
    <!-- /component handle events -->

    <!-- component content -->
    <c:PMA_Toasts aura:id="toasts"/>

    <!-- wizzard header -->
    <lightning:layout multipleRows="true" verticalAlign="start" class="pma-app">
        <lightning:layoutItem flexibility="auto" size="12" class="section">
            <c:PMA_WizardHeader step="{!v.step}" account="{!v.account}"/>
        </lightning:layoutItem>

        <lightning:layoutItem flexibility="auto" size="12" class="section">
            <div aura:id="sectionMain" class="section-item-main">
                <aura:if isTrue="{!v.step == 'dealerEmployees'}">
                    <c:PMA_DealerEmployees aura:id="dealerEmployees" accountId="{!v.accountId}" settings="{!v.settings}"/>
                </aura:if>

                <aura:if isTrue="{!v.step == 'dealerInformation'}">
                    <c:PMA_DealerInformation aura:id="dealerInformation" accountId="{!v.accountId}"/>
                </aura:if>

                <aura:if isTrue="{!v.step == 'trainingInformation'}">
                    <c:PMA_TrainingInformation aura:id="trainingInformation" accountId="{!v.accountId}"/>
                </aura:if>

                <aura:if isTrue="{!v.step == 'alignedBodyshop'}">
                    <c:PMA_AlignedBodyshop aura:id="alignedBodyshop" accountId="{!v.accountId}"/>
                </aura:if>

                <aura:if isTrue="{!v.step == 'futureVisits'}">
                    <c:PMA_FutureVisits aura:id="futureVisits" accountId="{!v.accountId}" userId="{!v.userId}" eventRecordTypeId="{!v.eventRecordTypeId}"/>
                </aura:if>
            </div>
        </lightning:layoutItem>

        <!-- spinner -->
        <lightning:spinner variant="brand" size="medium" alternativeText="Loading..." class="{!v.asyncProcesses == 0 ? 'slds-hidden' : ''}"/>

        <lightning:layoutItem flexibility="auto" size="12" class="section">
            <!-- wizzard footer -->
            <c:PMA_WizardFooter steps="{!v.steps}" step="{!v.step}"/>
        </lightning:layoutItem>
    </lightning:layout>

    <!-- /component content -->

</aura:component>"

 
Hi all, 

We created a custom object and have code that will email the related contacts with a defined role. We're wanting to expand this to include another role but also send a different template altogether. The prerequisite is when the record has a specific value. Here's the code I've created. Any help would be most appreciated. 

User-added image

User-added image
Hi all,

I'm having difficulty locating the exact code where the hover details appear. Can anyone tell me whether this is the right part of the code? I'm trying to find this bit of info? (hover details)

User-added image

User-added image
Hi all, 

I'm trying to create a new visualforce page that can accessed via a custom button to display a list of records. 

I've tried to create the custom object controller using the code below but get three errors. The custom object is called IT Assets. 

API Name: IT_Asset__c
Object Name: IT_Asset

Unknown property 'EmployeeListWithController.IT_Asset__c'
Invalid type: IT_Asset
Illegal conversion from List<IT_Asset__c> to List<IT_Asset>
public class EmployeeListWithController {
private String sortOrder = 'Name';
public List<IT_Asset> getIT_Asset() {
    List<IT_Asset__c> results = Database.query(
        'SELECT Id, Device_Type__c, Device_Model__c, Active__c, LastName' +
        'FROM IT_Asset__c ' +
        'ORDER BY ' + sortOrder + ' ASC ' +
        'LIMIT 10'
    );
    return results;
}
}

I've also written a visualforce page to access the records which is currently blank. I want to display just the active records (checkbox).
<apex:page controller="EmployeeListWithController">
    <apex:form>
        <apex:pageBlock title="Asset List" id="IT_Asset__c">
            <!-- IT_Assets List -->
<apex:pageBlockTable value="{! IT_Asset__c }" var="it">
    <apex:column value="{! it.Name }"/>
    <apex:column value="{! it.Device_Type__c }"/>
    <apex:column value="{! it.Device_Model__c }"/>
    <apex:column value="{! it.Active__c }"/>
</apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Can anyone offer some assistance please?
Hi all,

A developer had written an Apex Trigger for us years ago and we're now getting an error. We don't have a developer at the moment due to him having covid19, I was wondering whether anyone here can assist. This is stopping us creating tasks.

This is the error we're getting:
Apex trigger TaskTrigger caused an unexpected exception, contact your administrator: TaskTrigger: System.LimitException: Too many query rows: 50001

Here's the code:
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
MODIFICATION HISTORY

RG  ray@forceclarity.com (email me!)

07/09/2012  RG  created
23/10/2012  RG  enabled OnBeforeInsert for UpdateServiceNameOnOutbounds() 
06/11/2012  RG  enabled AfterInsert and AfterUpdate for calculation of Total Outbound Calls on parent Account
10/12/2014  RG  added Trigger.newMap to before insert and before update  
  
*/

trigger TaskTrigger on Task (after delete, after insert, after undelete, after update, before delete, before insert, before update) {
    
    Task_TriggerHandler handler = new Task_TriggerHandler(Trigger.isExecuting, Trigger.size);
    
    if (Task_TriggerHandler.isExecuteTrigger) {
      
        if(Trigger.isInsert && Trigger.isBefore){
            handler.OnBeforeInsert(Trigger.new, Trigger.newMap);
        } 
        else if(Trigger.isInsert && Trigger.isAfter){
            handler.OnAfterInsert(Trigger.new, Trigger.newMap);
            //TaskTriggerHandler.OnAfterInsertAsync(Trigger.newMap.keySet());
        }
    
        else if(Trigger.isUpdate && Trigger.isBefore){
            handler.OnBeforeUpdate(Trigger.old, Trigger.new, Trigger.newMap);
        }
       
        else if(Trigger.isUpdate && Trigger.isAfter){
            handler.OnAfterUpdate(Trigger.old, Trigger.new, Trigger.newMap);
            //TaskTriggerHandler.OnAfterUpdateAsync(Trigger.newMap.keySet());
        }        
    }
    

}

 
Can someone help. 

I'm trying to remove a section from a visualforce page and keep getting this error. The section to be removed is below. 


Error: LandRoverCalltoAction line 238, column 15: The element type "apex:form" must be terminated by the matching end-tag "</apex:form>"


Error: The element type "apex:form" must be terminated by the matching end-tag "</apex:form>".

 
<div class="form-section">
                            <div class="form-row">
                                <div class="form-field">
                                    <label class="form-field__label" for="searchField">Postcode</label>
                                    <div class="postcode__input">
                                        <div class="form-field__input">
                                            <apex:inputField id="searchField" value="{!Account.Postcode_Hidden__c}" required="true"/>
                                        </div>

                                        <input id="searchButton" class="form-button form-button--primary" type="button"
                                               onclick="findByPostcode()" value="Find" />

                                    </div>

                                    <div id="selectDropdownDiv" class="selectDropdownDiv">
                                        <label class="form-field__label" for="addressListSelect">Please select your address</label>
                                        <select id="addressListSelect" class="addressListSelect"></select>
                                    </div>
                                    <div class="errorDateMsg" id="errorAddrMsg" style="display: none">Please type the postcode and select your address</div>

                                    <div id="form-address" class="form-address">
                                        <output id="output-address1"></output>

                                        <output id="output-town"></output>

                                        <output id="output-postcode"></output>
                                    </div>

                                    <div id="form-address-apex" class="form-address-apex">
                                        <apex:inputField id="form__address_1" required="true" value="{!Account.BillingStreet}"/>
                                        <apex:inputField id="form__city" value="{!Account.BillingCity}"/>
                                        <apex:inputField id="postcode__box" value="{!Account.BillingPostalCode}"/>
                                    </div>
                                    
                                </div>
                            </div>

                        </div>


 
Hi all, 

We created a custom object and have code that will email the related contacts with a defined role. We're wanting to expand this to include another role but also send a different template altogether. The prerequisite is when the record has a specific value. Here's the code I've created. Any help would be most appreciated. 

User-added image

User-added image