• Chelsea Hirschton 9
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hello!

We have a list of 15 checkboxes on the Opportunity object capturing the different options for strategic priorities. I need to map these into a visualforce email template, but only want to include the field label values for the boxes that are checked. I want to display these in a list format. 

So far, I have the if statements down to display the hard coded field label if the chekbox is checked (would love the field label to be dynamic) per checkbox. But if it's false, a blank space displays which looks funny in the end output. How can I dynamically review all 15 checkboxes and display the field labels for those boxes that are checked?

Template below:

<p><b>AMOUNT:</b> {!Opportunity.Amount}
<br>
<br><b>GRANTING AGENCY:</b> {!Opportunity.Account}
<br>
<br><b>GRANT TITLE:</b> {!Opportunity.Name}
<br>
<br><b>DATES OF GRANT:</b> {!Opportunity.npsp__Grant_Period_Start_Date__c} - {!Opportunity.npsp__Grant_Period_End_Date__c}
<br>
<br><b>PURPOSE:</b> {!Opportunity.Description} 
<br>
<br><b>STRATEGIC PRIORITIES/DISTRICT GOALS:</b>
<br>{! if(Opportunity.African_American_Achievement__c, "African American Achievement", "")}
<br>{! if(Opportunity.Central_Office_Service_Culture__c, "Central Office Service Culture", "")}
<br>{! if(Opportunity.College_Career__c, "College/Career", "")}
<br>{! if(Opportunity.Digital_District_Access_to_Technology__c, "Digital District: Access to Technology", "")}
<br>{! if(Opportunity.English_Learners__c, "English Learners", "")}
<br>{! if(Opportunity.Health_and_Wellness__c, "Health and Wellness", "")}
<br>{! if(Opportunity.Instructional_Guidance_Professional_Dev__c, "Instructional Guidance Professional Dev", "")}
<br>{! if(Opportunity.Leadership_Development__c, "Leadership Development", "")}
<br>{! if(Opportunity.Parent_School_Community_Relations__c, "Parent School Community Relations", "")}
<br>{! if(Opportunity.Safe_and_Supportive_Schools__c, "Safe and Supportive Schools", "")}
<br>{! if(Opportunity.Students_with_Disabilities__c, "Students with Disabilities", "")}
<br>{! if(Opportunity.Talent_and_Culture_Human_Capital__c, "Talent and Culture Human Capital", "")}
<br>{! if(Opportunity.Teaching_and_Learning_Arts__c, "Teaching and Learning Arts", "")}
<br>{! if(Opportunity.Teaching_and_Learning_Core_Curriculum__c, "Teaching and Learning Core Curriculum", "")}
<br>{! if(Opportunity.Doesn_t_fall_within_strategic_priorities__c, "Doesn't fall within strategic priorities", "")}

Record Link: {!Opportunity.Link}
</p>
Hello!

We have a list of 15 checkboxes on the Opportunity object capturing the different options for strategic priorities. I need to map these into a visualforce email template, but only want to include the field label values for the boxes that are checked. I want to display these in a list format. 

So far, I have the if statements down to display the hard coded field label if the chekbox is checked (would love the field label to be dynamic) per checkbox. But if it's false, a blank space displays which looks funny in the end output. How can I dynamically review all 15 checkboxes and display the field labels for those boxes that are checked?

Template below:

<p><b>AMOUNT:</b> {!Opportunity.Amount}
<br>
<br><b>GRANTING AGENCY:</b> {!Opportunity.Account}
<br>
<br><b>GRANT TITLE:</b> {!Opportunity.Name}
<br>
<br><b>DATES OF GRANT:</b> {!Opportunity.npsp__Grant_Period_Start_Date__c} - {!Opportunity.npsp__Grant_Period_End_Date__c}
<br>
<br><b>PURPOSE:</b> {!Opportunity.Description} 
<br>
<br><b>STRATEGIC PRIORITIES/DISTRICT GOALS:</b>
<br>{! if(Opportunity.African_American_Achievement__c, "African American Achievement", "")}
<br>{! if(Opportunity.Central_Office_Service_Culture__c, "Central Office Service Culture", "")}
<br>{! if(Opportunity.College_Career__c, "College/Career", "")}
<br>{! if(Opportunity.Digital_District_Access_to_Technology__c, "Digital District: Access to Technology", "")}
<br>{! if(Opportunity.English_Learners__c, "English Learners", "")}
<br>{! if(Opportunity.Health_and_Wellness__c, "Health and Wellness", "")}
<br>{! if(Opportunity.Instructional_Guidance_Professional_Dev__c, "Instructional Guidance Professional Dev", "")}
<br>{! if(Opportunity.Leadership_Development__c, "Leadership Development", "")}
<br>{! if(Opportunity.Parent_School_Community_Relations__c, "Parent School Community Relations", "")}
<br>{! if(Opportunity.Safe_and_Supportive_Schools__c, "Safe and Supportive Schools", "")}
<br>{! if(Opportunity.Students_with_Disabilities__c, "Students with Disabilities", "")}
<br>{! if(Opportunity.Talent_and_Culture_Human_Capital__c, "Talent and Culture Human Capital", "")}
<br>{! if(Opportunity.Teaching_and_Learning_Arts__c, "Teaching and Learning Arts", "")}
<br>{! if(Opportunity.Teaching_and_Learning_Core_Curriculum__c, "Teaching and Learning Core Curriculum", "")}
<br>{! if(Opportunity.Doesn_t_fall_within_strategic_priorities__c, "Doesn't fall within strategic priorities", "")}

Record Link: {!Opportunity.Link}
</p>
Hi I was hoping someone would be able to give me a little advice or point me in the right direction if the information is already documented somewhere. Im looking to build some functionality onto an object where the quantity of a quantity field would define the quantity of records to create. Similar to how payment schedule works on products. So if I specified 10 in quantity box it would create 10 related object records.