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
Lindsay87Lindsay87 

Help with Call Center Scripts

Hi All!  We would like to set up a type of call center scripts for our users when they leave messages with customers.  We are trying to set up a visualforce page but seem to have trouble pulling in the 'First Name' from the Account object.  

Right now, we have it set up as a pop-up - though I cannot figure out how to make the pop-up open in a new window.  Here's the Apex code and Visualforce code as of right now:
 
public with sharing class TestPopup { 
    public String getContact() {
        return null;
    }
    public TestPopup() {
    }
    public TestPopup(Account controller) {
    }
    public TestPopup(ApexPages.StandardController controller) {
    }
    public String account { get; set; }
    public boolean displayPopup {get; set;}     
    public void closePopup() {        
        displayPopup = false;    
    }     
    public void showPopup() {        
        displayPopup = true;    
    }
  }

Visualforce:
<apex:page standardController="Account" extensions="TestPopup">

<apex:form >
<apex:pageBlock >
<apex:commandButton value="Follow Up Day 2" action="{!showPopup}" rerender="popup" status="status"/>
             <apex:outputPanel id="popup">
                <apex:outputPanel id="popInnerOutputPnl" styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
                     <apex:commandButton value="X" title="Close the popup" action="{!closePopup}" styleClass="closeButton" rerender="popup">
                     </apex:commandButton>
                     <apex:pageblockSection >                         
                         
                         <apex:pageblockSectionItem >
                          Hello this is {!$User.FirstName} {!$User.LastName} with ___ and this message is for FIRSTNAME.  
                          I wanted to reach out to you because I just had a customer that came back in and met with the CAD team to design and price out their home.  
                          They were amazed that they were able to sit down and actually have us draw their home and the changes they wanted.  
                          They said it really helped them envision how their new home was going to look and feel.
                          So, I would like to extend that same opportunity to you.  We can set up a time for you to meet and can get things started for you.  
                          I think this would be a really good next step for you and I would be happy to get this scheduled.
                          You can reach me at {!$User.Phone}.  Thank you FirstName have a great rest of the day!
                         </apex:pageblockSectionItem>
                   </apex:pageblocksection>
                </apex:outputPanel>
            </apex:outputPanel>
            </apex:pageBlock>
              </apex:form>
                  <style type="text/css">
.customPopup {
    background-color: white;
    border-style: solid;
    border-width: 2px;
    left: 20%;
    padding: 10px;
    position: absolute;
    z-index: 9999;
    /* These are the 3 css properties you will need to tweak so the pop 
                            up displays in the center of the screen. First set the width. Then set 
                            margin-left to negative half of what the width is. You can also add 
                            the height property for a fixed size pop up.*/
    width: 500px;
    top: 20%;
}

.disabledTextBox {
    background-color: white;
    border: 1px solid;
    color: black;
    cursor: default;
    width: 400px;
    display: table;
    padding: 2px 1px;
    text-align:right;
}   

.closeButton {
    float: right;
}
</style>


</apex:page>

I am not a developer and most of this I did copy and paste from other posts - but could not find anything that would allow me to do a pop up script and pull the information (first name) from the account.  

Can anyone point us in the right direction to pull the first name into this script pop up?

Thanks!