• Megan Moody 10
  • NEWBIE
  • 45 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 14
    Replies
I'm trying to get the background color of my text template in a visual flow to be white. However, whenever I use standard HTML syntax it doesn't reflect on the output. 

I've tried putting it in a header
<h2 style="background-color:white">
Background-color set by using red
</h2>

I've tried putting the text inside a table and setting the color of the background of the table. 

Is this a limitation of text templates in visual flows? Or am I missing something obvious? 
I want to display the cases related list on the Home Page for my Community users. I can easily do this via a Visualforce page. The problem is that when the user clicks a case number to open the case, it opens the whole Salesforce instance in the home page frame (see screen shots for better understanding). I need it to either open only the case in that frame OR to launch a new tab with the case. Any ideas how I can acheived this? 

My Visualforce code:
 
<apex:page showHeader="false">
<apex:listViews type="Case"/> 
</apex:page>

Here's what it currently does when I click on the case number. 

User-added image

User-added image
 
I am a newbie at development. I have an Apex class and a Visualforce page that I need test coverage for. I just can't get complete code coverage. Any help in getting me closer to 100% code coverage for this is very much appreciated!

My Apex class:
public class ConciergeDisplayFamilyMembers
{ 
    public Contact currentContact {get;set;}     
    
    // Get Record Type ID for EE Consumer Contact records
       RecordType rtee = [select id from RecordType where SobjectType='Contact' and Name='EE Consumer' Limit 1];
    
    public List<Contact> Records
    {
        
        get
        {
            try
            {
                Records = new List<Contact>();
                Records =   [
                            SELECT Name,Gender__c,Subscriber_ID__c,Member_ID_suffix__c,Member_ID__c 
                            FROM Contact 
                            WHERE Subscriber_ID__c = :currentContact.Subscriber_ID__c
                               and Subscriber_ID__c != null
                               and Health_Plan__c = :currentContact.Health_Plan__c
                               and RecordTypeId = :rtee.id
                            ORDER BY Member_ID_suffix__c
                            ]; 
            } 
            catch (Exception ex)
            {
                  Records = null;
            }
            return Records;
        }
        private set;
    }
        

    public ConciergeDisplayFamilyMembers(ApexPages.StandardController sc)
    {
        if(!Test.isRunningTest()){
        sc.AddFields(new List<String>{'Subscriber_ID__c'});
        sc.AddFields(new List<String>{'Health_Plan__c'});
        currentContact = (Contact) sc.getRecord();     
        System.debug('***** ' + currentContact );
            }
    }

}


My Visualforce page:
<apex:page standardController="Contact" extensions="ConciergeDisplayFamilyMembers">
<style>
    span.EmployerIneligible
        {background-color:red; font-size:125%; font-weight:bold;}

    span.EmployeeEligible
        {background-color:#00FF00; font-size:125%; font-weight:bold;}    

    span.EmployeeIneligible
        {background-color:orange; font-size:125%; font-weight:bold;}
        
    span.CoverageDates
        {font-size:110%; font-weight:bold;}

        
</style>

<apex:pageBlock >

<apex:panelGrid >
    <apex:outputPanel rendered="{!Contact.Service_Status__c == 'Employer Not Eligible'}">
        <span class="EmployerIneligible">{!Contact.Service_Status__c}</span>
        
    </apex:outputPanel>
    
    <apex:outputPanel rendered="{!Contact.Service_Status__c == 'Employee Not Eligible'}">
        <span class="EmployeeIneligible">{!Contact.Service_Status__c}</span>
        <span class="CoverageDates">
                <apex:outputText value="{0, date, M'/'d'/'yyyy}">
                    <apex:param value="{!Contact.Coverage_Start_Date__c}" /> 
                </apex:outputText>
                <apex:outputText > - </apex:outputText>
                <apex:outputText value="{0, date, M'/'d'/'yyyy}">
                    <apex:param value="{!Contact.Coverage_End_Date__c}" /> 
                </apex:outputText>
              
        </span>    

    </apex:outputPanel>
    
    <apex:outputPanel layout="block" rendered="{!Contact.Service_Status__c == 'Eligible'}">
        <apex:panelGrid columns="2">
            <span class="EmployeeEligible">{!Contact.Service_Status__c}</span>
        
            
                <apex:outputText ><span class="CoverageDates">Days since last activity: &nbsp;&nbsp;&nbsp; <apex:outputField value="{!Contact.Days_Since_Last_Activity__c}"/></span></apex:outputText> 
            
            

            <apex:Outputtext ><b>HS Products:&nbsp;&nbsp;&nbsp;</b></apex:Outputtext>
            <apex:outputText ><p id="demo"></p></apex:outputText>
            
            
        </apex:panelGrid>
    </apex:outputPanel>
</apex:panelGrid>
 
</apex:pageBlock>

    <apex:pageBlock title="Family Members"> 
        <apex:pageBlockTable value="{!Records}" var="Record" > 
            <apex:column > 
                <apex:facet name="header">Name</apex:facet> 
                <apex:outputLink target="_self" value="{!Record.ID}">{!Record.Name}</apex:outputlink>
            </apex:column> 
            <apex:column > 
                <apex:facet name="header">Member ID</apex:facet> 
                <apex:outputText value="{!Record.Member_ID__c}"/> 
            </apex:column>
            <apex:column > 
                <apex:facet name="header">suffix</apex:facet> 
                <apex:outputText value="{!Record.Member_ID_suffix__c}"/> 
            </apex:column>  
            <apex:column > 
                <apex:facet name="header">Gender</apex:facet> 
                <apex:outputText value="{!Record.Gender__c}"/> 
            </apex:column> 
            <apex:column > 
                <apex:facet name="header">Subscriber ID</apex:facet> 
                <apex:outputText value="{!Record.Subscriber_ID__c}"/> 
            </apex:column> 
        </apex:pageBlockTable> 
    </apex:pageBlock>
    
    
        
        <apex:relatedList list="Cases"/>
        
    

<script>
    var myString = '{!Contact.Account.Concierge_HS_Products__c}';
    var res = myString.replace(new RegExp(';', 'g'), '<br/>');
    document.getElementById("demo").innerHTML =res;       
</script>


</apex:page>
Here's the test class I've written. It only gets 23% code coverage:
@isTest
private class TestConciergeDisplayFamilyMembers{


    public static testmethod void testConciergeDisplayFamilyMembers(){
        
        // Get Record Type ID for EE Consumer Contact records
       RecordType rtee = [select id from RecordType where SobjectType='Contact' and Name='EE Consumer' Limit 1];
      RecordType rthp = [select id from RecordType where SobjectType='Account' and Name='Customer - Health Plan' Limit 1];
      RecordType rtemp = [select id from RecordType where SobjectType='Account' and Name='Customer - Employer' Limit 1];
        
        //Create Employer Account
        Account objAccount = New Account();
        objAccount.Name = 'Test Employer Account';
        objAccount.Type = 'Customer';
        objAccount.Customer_Type__c = 'Employer'; 
        objAccount.RecordTypeId = rtemp.id;
        objAccount.generated_from_leads__c = true;
        Insert objAccount;
    
        Account empAccount = objAccount;
        
        //Create Health Plan Account
        Account objAccountHP = New Account();
        objAccountHP.Name = 'Test Health Plan';
        objAccountHP.Type = 'Customer';
        objAccount.Customer_Type__c = 'Health Plan'; 
        objAccountHP.RecordTypeId = rthp.id;
        objAccountHP.generated_from_leads__c = true;
        Insert objAccountHP;
        
        Account hpAccount = objAccountHP;
        
        //Create Contacts with same subscriber number
        List<Contact> objContact = new List<Contact>();
        for (integer j=0;j<3;j++){
             objContact.add(new Contact(FirstName='Test' + j,
                                 LastName='Test' +j,
                                AccountId= empAccount.Id,
                                Subscriber_ID__c = '11111',
                                RecordTypeId = rtee.id,
                                Health_Plan__c = hpAccount.Id,
                                Member_ID__c = '1'));
                    }
        insert objContact;
        
        //Create Contacts with different subscriber number
        List<Contact> objContact2= new List<Contact>();
        for (integer j=10;j<15;j++){
             objContact2.add(new Contact(FirstName='Test' + j,
                                 LastName='Test' +j,
                                AccountId= objAccount.Id,
                                Subscriber_ID__c = '1234',
                                RecordTypeId = rtee.id,
                                Health_Plan__c = objAccountHP.Id,
                                Member_ID__c = '1'));
          }
        insert objContact2;
        
        //Get the ID of the first contact created
        Contact firstContact = [SELECT ID, firstname,Subscriber_ID__c, Member_ID__c FROM Contact WHERE ID = :objContact[0].Id];
        system.debug('first contact: ' + firstContact.ID + ' ' + firstContact.FirstName);
          
        PageReference myVfPage = Page.Concierge_Service_Status;
        Test.setCurrentPage(myVfPage);
        ConciergeDisplayFamilyMembers testFamily = new ConciergeDisplayFamilyMembers(new ApexPages.StandardController(firstContact));
        ApexPages.StandardController sc = new ApexPages.StandardController(firstContact);
          //ConciergeDisplayFamilyMembers testFamily = new ConciergeDisplayFamilyMembers(sc);
        Contact primaryContact = testFamily.currentContact;
        }

}
 
I have a simple pageblocksection in my VF page in which I went to display a contact's associated Account record and then a custom lookup field. The problem is that when I display the contact's associated account, it doesn't provide a hyperlink to the account as it does for my custom lookup field.

User-added image

I can get the Account to become a hyperlink by using the outputLink tag, but then I don't have a label next to it. 

User-added image

Is there anyway to display a label next to the linked Account Name such that it looks like the label "Health Plan" below it? 

 
I'd like to make the display of the selected multi select picklist items more visually friendly in my VF page. Selected values are displayed by dfault like "option 1; option 2; option 6". I'd like it to display in a vertical list like so:

option 1
option 2
option 6

This is only for display purposes. The user doesn't need to add or remove values from the picklist. Is there a way to do this in a VF page? Thanks!
I have a VF page in a Service Cloud console. I want it to display all other contacts with the same value in a custom field of the current contact. For some reason my Apex class won't get the current contact record. My two code snippets are below. Anyone with ideas as to why this isn't working? Any help is much appreciated. 
 
public class ConciergeDisplayFamilyMembers
{ 
    public Contact currentContact {get;set;}
    
    public List<Contact> Records
    {
        get
        {
            try
            {
                Records = new List<Contact>();
                Records = [SELECT Name,Gender__c,Subscriber_ID__c,Member_ID_suffix__c,Member_ID__c FROM Contact WHERE Subscriber_ID__c = :currentContact.Subscriber_ID__c AND RecordTypeId = '012q00000004SAiAAM']; 
            } 
            catch (Exception ex)
                {
                Records = null;
                }
                return Records;
        }
        private set;
        }
        

    public ConciergeDisplayFamilyMembers(ApexPages.StandardController sc)
    {
        currentContact = (Contact) sc.getRecord();
    }

}
 
<apex:page standardController = "Contact" extensions="ConciergeDisplayFamilyMembers"> 
    <apex:pageBlock > 
        <apex:pageBlockTable value="{!Records}" var="Record"> 
            <apex:column > 
                <apex:facet name="header">Name</apex:facet> 
                <apex:outputText value="{!Record.Name}"/> 
            </apex:column> 
            <apex:column > 
                <apex:facet name="header">Member ID</apex:facet> 
                <apex:outputText value="{!Record.Member_ID__c}"/> 
            </apex:column>
            <apex:column > 
                <apex:facet name="header">suffix</apex:facet> 
                <apex:outputText value="{!Record.Member_ID_suffix__c}"/> 
            </apex:column>  
            <apex:column > 
                <apex:facet name="header">Gender</apex:facet> 
                <apex:outputText value="{!Record.Gender__c}"/> 
            </apex:column> 
            <apex:column > 
                <apex:facet name="header">Subscriber ID</apex:facet> 
                <apex:outputText value="{!Record.Subscriber_ID__c}"/> 
            </apex:column> 
        </apex:pageBlockTable> 
    </apex:pageBlock> 
</apex:page>

In the apex class, if I leave out the part of the WHERE clause that is searching for the custom field value (
WHERE Subscriber_ID__c = :currentContact.Subscriber_ID__c) and just search on the record type, it returns records. But with the Subscriber_ID__c field, it never returns any records. 
I'm a novice at Apex and VF development. I'm just trying to create a VF page that displays all contact records where a particular field equals a value from the current record, which is a contact record. 

My VF code is using this apex controller code. I am getting a blank back in the Subscriber_ID__c value. 

I'm surely missing a simple step in my code. Can anyone help?

public with sharing class ConciergeDisplayFamilyMembers

    public String subscriberID {get;set;}
    public List<Contact> Records {get; set;} 
    
    public ConciergeDisplayFamilyMembers()
    { 
        Records = 
            [SELECT Name,Gender__c,Subscriber_ID__c,Member_ID_suffix__c,Member_ID__c FROM Contact WHERE Subscriber_ID__c = :subscriberID]; 
    } 

public ConciergeDisplayFamilyMembers(ApexPages.StandardController sc)    
    {            
    subscriberID = ApexPages.CurrentPage().getparameters().get('Subscriber_ID__c');
    }
}
 
Is it possible to create a custom link in a search result list? What I want is to remove the "Del" action link (I know how to do this) and replace it with a custom link "DNE" which will have an action attached to it that will create an activity logging that a call was received rom a DNE client. Basically, I want to save my reps the time of clicking into the record and logging an activity if they see the "Rep Do Not Engage" flag is true. Is this possible?


User-added image