• Dave Berenato
  • NEWBIE
  • 185 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 51
    Replies
I made an Apex Class to create a Note (we use a Custom Note Object Note__c)
 
public class NewNoteAccount {
    
    public id AccId;    
    public Account Acc{get;set;}
    public Note__c note {get;set;}
    public NewNoteAccount(ApexPages.StandardController stdController){

        this.Acc = (Account)stdController.getRecord();
        string AccId = Acc.id;
        
        Acc=[SELECT ID,Name FROM Account WHERE id=:AccId];
        
        note = new Note__c();
        note.Account__c = Acc.Id;

    }   
        public PageReference Create(){
        insert note;
        PageReference pageRef = new PageReference('/lightning/r/Account/' + AccId + '/view');
        pageRef.setRedirect(true);
        return pageRef;
		}

}

I put the Visualforce Page in a Lightning Action so I can create a Note from the Account:
 
<apex:page lightningStylesheets="true" standardController="Account" extensions="NewNoteAccount" showHeader="false">

<script type="text/javascript"> function CloseWindow()  {   window.close();  }
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }

 </script>


<apex:form >
    <apex:pageBlock title="New Note">
        <apex:pageBlockSection >
            <apex:inputfield value="{!Note.Name}" required="true"/>
            <apex:inputfield value="{!Note.Content__c}" required="true"/>
           <br/>
            <apex:outputfield value="{!Note.Account__c}" style="width:90%"/>
        </apex:pageBlockSection>
        <apex:commandButton value="Create" action="{!Create}" styleClass="slds-button slds-button_brand"  status="closer" oncomplete="CloseWindow();"/>
    </apex:pageBlock>
    </apex:form>    
</apex:page>

But when I click Create on the Lightning Action, it loads the URL:
 
https://corere--fair.lightning.force.com/lightning/r/Account/null/view

Why doesn't the URL have access to AccId?
I have a Lightning Action that is loading custom Visualforce to allow the user to update fields on a child record (Contact_Phone_Number__c) and the parent record (Lead) in a single Edit:

User-added image

I was able to find code to reactivate the Save Button at the bottom right:
 
<apex:page standardController="Contact_Phone_Number__c" extensions="PhoneUpdateLead" showHeader="false" >
    <html>
	<script type='text/javascript' src='/canvas/sdk/js/publisher.js'>
        // Activate 'Save button' when the panel shows up 
        Sfdc.canvas.publisher.subscribe({name: "publisher.showPanel", 
                                         onData:function(e) { Sfdc.canvas.publisher.publish({
                                             name:"publisher.setValidForSubmit", payload:"true"}); }}); 
        // Subscribe to the Save button to influence custom logi 
        Sfdc.canvas.publisher.subscribe({ name: "publisher.post", 
                                         onData: function(e) { 
        // **TODO** // Do whatever you want to do here when the user clicks save button //** END TODO** 
        // Gracefully close the popup when user taps save 
        
                                             {!savePhone}                                     
                                             
        Sfdc.canvas.publisher.publish({ name: "publisher.close", payload:{ refresh:"true" }}); }}); 
     </script>
  <body> 
    <apex:form >
        <apex:pageBlock mode="maindetail">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{!phone.User_Disposition__c}"/>
                <apex:inputField value="{!l.Status}"/>
                </apex:pageBlockSection>
        </apex:pageBlock>
        
        <div class="slds-align--absolute-center">
	<div class="slds-is-relative">
	 </div>
	<apex:commandButton value="Save" action="{!savePhone}"/>
	</div>
    </apex:form>
  </body>
</html>
</apex:page>

Essentially I am updating fields on both the parent and child record. Ideally the Save button would complete this "savePhone" process in my Apex.
 
public class PhoneUpdateLead {
    
    public string phoneId {get;set;}
    public string LeadId {get;set;}
    public string AppId {get;set;}
    public Contact_Phone_Number__c phone{get;set;}
    public Lead l{get;set;}
    
  public PhoneUpdateLead(ApexPages.StandardController stdcontroller) {
        
    phoneId = stdController.getId();
        
        List<Contact_Phone_Number__c> phonelist = [Select Id,Name,Lead__c,User_Disposition__c,Lead__r.Id FROM Contact_Phone_Number__c Where Id = :phoneId];
        
        if(!phonelist.isEmpty()) {phone = phonelist[0];} else{system.debug('Phone List is Empty');}
        if(!phonelist.isEmpty()) {LeadId = phonelist[0].Lead__r.Id;} else{system.debug('Lead List is Empty');}
        
        List<Lead> leadlist = [Select Id,Name,Status
                                 FROM Lead Where Id = :LeadId];
        
        if(!leadlist.isEmpty()) {l = leadlist[0];} else{system.debug('Lead List is Empty');}

  }
       public void savePhone(){
           update phone; update l;}
}

But the error message when I place {!savePhone} in the Javascript is:
 
Unknown property 'Contact_Phone_Number__cStandardController.savePhone'

 
Is there anything I can do to the difference between two dates to convert it to a number that could be used in a large calculation (multiply by an integer or a currency field) in a field update for a currency field?
DATE(2019,7,1) – DATE(2019,5,1)

This by itself, as well as in the larger formula where this difference is used to calculate a pro-rated price, gives a "Syntax Error" for a Field Update to a Currency Field
I have a Visual Workflow that identifies if a record is already attached or if it needs to find a record to attach:

So it's a Decision:
User-added image


Then a Record Lookup called "FindPhone"

User-added image

Most calls (Task records) shouldn't even make it to this point, it's only for calls that happened to not save to their related "Contact Phone Number." For some reason, every call record has been erroring with the FindPhone not being able to find the record. I thought if Record Lookups didn't find a record, they just moved on with the ID as a null value? Is this not the case?

User-added image

User-added image

This flow worked for months and months with no issue and today it stopped working.
 
I'm using a mapping tool to Map a custom object I have for Real Estate Listings. Each Listing has a Parent Record (Contact) for the Listing Agent. I want to identify a subset of listings on the map, and then create a campaign out of those agent Contacts.

The goal is to update a field on the Listing that will trigger a Flow to add their Parent - Contacts to a Campaign.

The problem is that in any given subset of listings, there might be a Contact duplicate. So the mass update happens to the Listing, it errors because it tries to add the same Contact to a campaign multiple times.

Has anyone come across a workaround for this issue? That if a mass update is adding Campaign Members, it won't roll-back on error?
I have a Visualforce Page with a Standard Controller that comes from a Pop-Up Window that I would love to have either redirect to a Visualforce page or Close the Window onComplete.

Option 1: Close the Window
 
<apex:page standardController="Account" showHeader="false">
  
  <script type="text/javascript">
   function CloseWindow()
    { 
    window.top.close(); 
    UpdateOpener(); 
    }
 </script>
 
    <apex:form >
            <apex:pageBlock mode="maindetail">
                <apex:pageBlockSection columns="2" title="Seller Info">
                    <apex:inputField value="{!Account.Seller_1_First_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_First_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_1_Middle_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_Middle_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_1_Last_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_Last_Name__c}"/>
                    <apex:inputField value="{!Account.Intake_Packet_For__c}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection columns="2" title="Listing Info">
                    <apex:inputField value="{!Account.Listing_Agent__c}"/>
                    <apex:inputField value="{!Account.Co_Listing_Agent__c}"/>
                    <apex:inputField value="{!Account.Intake_Listing_Price__c}"/>
                    <apex:inputField value="{!Account.Intake_RLADate__c}"/>
                    <apex:inputField value="{!Account.Intake_Listing_Percentage__c}"/>
                    <apex:inputField value="{!Account.Intake_Buyer_s_Agent_Percentage__c}"/>
                </apex:pageBlockSection>
                <apex:pageBlockButtons >
                <apex:commandButton value="Generate Packet" action="{!save}"  onComplete="CloseWindow();" />
            </apex:pageBlockButtons>
            </apex:pageBlock>
            
    </apex:form>

</apex:page>

Option 2: Redirect to a "Thank You" Visualforce Page
 
<apex:page standardController="Account" showHeader="false">
 
    <apex:form >
            <apex:pageBlock mode="maindetail">
                <apex:pageBlockSection columns="2" title="Seller Info">
                    <apex:inputField value="{!Account.Seller_1_First_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_First_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_1_Middle_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_Middle_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_1_Last_Name__c}"/>
                    <apex:inputField value="{!Account.Seller_2_Last_Name__c}"/>
                    <apex:inputField value="{!Account.Intake_Packet_For__c}"/>
                </apex:pageBlockSection>
                <apex:pageBlockSection columns="2" title="Listing Info">
                    <apex:inputField value="{!Account.Listing_Agent__c}"/>
                    <apex:inputField value="{!Account.Co_Listing_Agent__c}"/>
                    <apex:inputField value="{!Account.Intake_Listing_Price__c}"/>
                    <apex:inputField value="{!Account.Intake_RLADate__c}"/>
                    <apex:inputField value="{!Account.Intake_Listing_Percentage__c}"/>
                    <apex:inputField value="{!Account.Intake_Buyer_s_Agent_Percentage__c}"/>
                </apex:pageBlockSection>
                <apex:pageBlockButtons >
                <apex:commandButton value="Generate Packet" action="{!save}"  oncomplete="{!URLFOR('https://corere--c.na50.visual.force.com/apex/thankyou')}" />
            </apex:pageBlockButtons>
            </apex:pageBlock>
            
    </apex:form>

</apex:page>

The first option, the save Button does nothing, the second option, it redirects to the record. Any suggestions?
 
If I have a column in an Apex:PageBlockTable for a Long Text Area, can I have the field Truncated to a certain number of characters with a Show More Link?
 
<apex:column width="300px">

            <apex:facet name="header">Description</apex:facet>

            <apex:outputText value="{!task.description}"/>

        </apex:column>

Some kind of href that will display the full field if clicked?
I'm running into an issue where I have too many buttons on the Lead page and they display in a drop-down list in Lightning. I want to use a Formula Field to open a Visualforce page, so I have this display on the top of the Lightning Lead view.

This is the button:
/apex/Application?leadid={!Lead.Id}&accid={! Lead.AccountId__c}

And the field would be:
HYPERLINK("/apex/Application?leadid="& Id & "accid=" & Account__r.Id , "Application")
I've seen people use "_target" but this forces a new tab in Google Chrome. Can I force a new Window, as well as set the height and width, all from a formula field?
 
I'm looking to display fields from an Account record (including fields from Lookup Objects that the Account is the child record for) and I'm probably missing something super simple but here is my class:
 
public class FileReview {
    
	public FileReview() 
    {myId = ApexPages.currentPage().getParameters().get('id');}
	public string myId {get;set;}
    Account acc = [Select Id,Name FROM Account Where Id = :myId];
}

And Visualforce Page:
 
<apex:page Controller="FAIRFileReview" showheader="false">
   {!acc.Name}
</apex:page>

Error is: "Unknown Property "FileReview.acc"

I tried to write "return acc;" underneath the Apex class but got "Expecting '}' but was: 'return' "
 
I found some code in another post to make a Javascript button open in a new subtab inside the console:
 
<apex:includeScript value="/soap/ajax/26.0/connection.js"/>
    <apex:includeScript value="/support/console/26.0/integration.js"/>
    <script type="text/javascript">
        
        window.onload = function(){
           testOpenSubtab();
        };

        function testOpenSubtab() {
            //First find the ID of the primary tab to put the new subtab in
            sforce.console.getEnclosingPrimaryTabId(openSubtab);
        };

        var openSubtab = function openSubtab(result){
            var primaryTabId = result.id;
            sforce.console.setTabTitle('Add Rep Note');
        };
        
   </script>

I tried it for an apex:outputLink and it didn't work:
 
<apex:outputLink value="/{! record.id }" target="_blank"  id="theLink"><apex:outputField value="{! record.Name }"/>


The other question (https://developer.salesforce.com/forums#!/feedtype=SINGLE_QUESTION_SEARCH_RESULT&id=906F0000000BTpTIAW) had code for the Javascript button but I don't know where to put that in the Visualforce Page.
{!REQUIRESCRIPT("/soap/ajax/28.0/connection.js")} 
{!REQUIRESCRIPT("/support/console/28.0/integration.js")} 

var url = '/apex/Add_Rep_Notes?Id={!Account.Id}&isdtp=vw'; 

if (sforce.console.isInConsole()) { 
    srcUp(url);
} else { 
    window.open(url,'_blank');
}
I'm going to need this for several links on the page so I don't know how the "var url" would work.
 
Hi everyone,

I have a Visualforce page that checks for an existing Lookup record. If it does not exist, it runs a Flow Interview to create one, and if it does exist, it loads a Visualforce webform I made that uses Standard Controller for that "Application__c" custom object.

My only issue is I need the <flow: interview> FinishLocation to pull a variable ID from the record created in the Visual Workflow. How can I achieve this and reference it in the Visualforce Page?
 
public class FAIRAssistanceApplication {

     public FAIRAssistanceApplication (ApexPages.StandardController controller) {
    }
    public ID getAccId = System.currentPagereference().getParameters().get('var_AccountID');
    
    
    public Flow.Interview.NewFAIRAppAuto NewAppFlow{get;set;}
    public String getAccountId(){ return getAccId; }

    public ID AppId = NewAppFlow.var_AppID;
    
    public PageReference getAppId(){
        
        if(NewAppFlow != null) AppId = NewAppFlow.var_AppID;

        PageReference send = new PageReference('/' + NewAppFlow.var_AppID);
        send.setRedirect(true);
        return send;

    }
    
}
 
<apex:page showheader="false" standardController="Application__c" extensions="FAIRAssistanceApplication">



<apex:pageblock rendered="{!IF(ISBLANK(Application__c.Property_Account__c),TRUE,FALSE)}">
    <flow:interview name="NewFAIRAppAuto" interview="{!NewAppFlow}" finishLocation="{!AppId}')}">
    </flow:interview>
</apex:pageblock>




<apex:form rendered="{!IF(NOT(ISBLANK(Application__c.Property_Account__c)),TRUE,FALSE)}">
    <p>{!Application__c.Property_Account__r.Name}</p>
    <p>{!Application__c.Name}</p>
    <p>Employer: <apex:inputField value="{!Application__c.Employer_Position_1__c}"/></p>
<apex:commandButton id="saveBtn" value="Save" action="{!save}" />


</apex:form>

</apex:page>

 
I have a Visualforce Page to make a new record of a custom object we call "Notes"
<apex:page standardController="Note__c" showHeader="false">
    <apex:form id="theForm">
        <table>
            <tr>
                <th rowspan="2">Note Type</th>
                <th>Note Name</th>
                <th>Note Body</th>
                <th rowspan="2"><apex:commandButton value="Save" action="{!Save}" rerender="theForm" /></th>
            </tr>
            <tr>
                
                <th><apex:inputField value="{!Note__c.Name}"/></th>
                <th><apex:inputField value="{!Note__c.Content__c}"/></th>
            </tr>
        </table>
    </apex:form>
</apex:page>

I want to display a link to the URL off the Account, which is the Parent object in a Master-Detail Relationship field (Account__c).

Can I preopulate the Lookup Field with this value using a URL from the Account?

I've tried:

1. 
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__c=0016A000001p8GD
2.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__r.Id=0016A000001p8GD
3.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?00N6A000008PlNb=0016A000001p8GD
4.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__c=12345+Test+Drive

But none of them work. Any ideas?


 
I'm building out a link on the Lead to allow our salespeople to fill out an Application (Application__c) for a client. 

I want the URL to be linked to the Lead where:
 
https://corere--app--c.cs71.visual.force.com/apex/AssistanceApplication?acc={!Account__r.Id}

And then I'm writing a controller to basically determine if that attached Account has an existing Application to be updated or a new one to be created before page-load.
 
public class FAIRAssistanceApplication {

    public FAIRAssistanceApplication(){myParam = ApexPages.currentpage().getParameters().get('acc');}
    
    public String myParam { get; set; }    

    public List<Account> getAccount(){
        Map<String, Account> ExistingAppID = new Map<String, Account>();
        for (Account mapaccount : [Select FAIR_Assistance_Application__r.Id FROM Account WHERE Id = :myParam LIMIT 1])
        {ExistingAppID.put(mapaccount.FAIR_Assistance_Application__r.Id,mapaccount);}
        return ExistingAppID.values();}

    public String ExistingAppID { get; set; }   

    public void getAppId()
    {
        if(ExistingAppID != Null)
            
			{string AppId = ExistingAppID;}

        else{
        
        	Application__c NewApp = new Application__c();
            
        	NewApp.Property_Account__c = myParam;
        	NewApp.Name = 'Test';            
            Insert NewApp;

        	Account acc2  = [Select id,Name FROM Account WHERE Id = :myParam LIMIT 1];
			acc2.FAIR_Assistance_Application__c = NewApp.Id;
        	update acc2;
            
        	string AppId = NewApp.Id;
        }
    }
    
    public String AppId { get; set; }  
    
    public FAIRAssistanceApplication(ApexPages.StandardController controller) {
		ApexPages.currentPage().getParameters().put('id', AppId);
    }

}

The Account is linked to the Application by the Lookup field "Assistance_Application__c" and the Application is linked back to the Account with a Master-Detail field "Property_Account__c."

The Visualforce page loads and it will essentially be a stylized webform of <apex: inputField> for the StandardController "Application__c"

I loaded the Visualforce page and tested one save where no Application existed and one where it did exist and neither worked. They saved new Applications with only the fields in the InputFields being populated.
I found a simple collapisble table online: https://codepen.io/andornagy/pen/gaGBZz

And I wanted to use it in a Visualforce page. I copied a simplified version of it, first with the Static Resource I called "Collapisble Table"
 
$(document).ready(function() {
	$('[data-toggle="toggle"]').change(function(){
		$(this).parents().next('.hide').toggle();
	});
});

And then wrote the Visualforce page accordingly:
 
<apex:page showheader="false" sidebar="false">

<apex:includeScript value="{!$Resource.CollapsibleTable}"/>


<style>
table { 
    width: 750px; 
    border-collapse: collapse; 
    margin:50px auto;
    }

th { 
    background: #3498db; 
    color: white; 
    font-weight: bold; 
    }

td, th { 
    padding: 10px; 
    border: 1px solid #ccc; 
    text-align: left; 
    font-size: 18px;
    }

.labels tr td {
    background-color: #2cc16a;
    font-weight: bold;
    color: #fff;
}

.label tr td label {
    display: block;
}


[data-toggle="toggle"] {
    display: none;
}
</style>

<table>
    <tbody>
        <tbody class="labels">
            <tr>
                <td colspan="5">
                    <label for="accounting">Accounting</label>
                    <input type="checkbox" name="accounting" id="accounting" data-toggle="toggle"/>
                </td>
            </tr>
        </tbody>
        <tbody class="hide">
            <tr>
                <td>Australia</td>
                <td>$7,685.00</td>
                <td>$3,544.00</td>
                <td>$5,834.00</td>
                <td>$10,583.00</td>
            </tr>
            <tr>
                <td>Central America</td>
                <td>$7,685.00</td>
                <td>$3,544.00</td>
                <td>$5,834.00</td>
                <td>$10,583.00</td>
            </tr>
        </tbody>
    </tbody>
</table>

</apex:page>

It loads property but the click to collapse functionality is missing. This is probably something really simple I'm missing. 
I'm writing a formula to convert a Number Field into a Word.

Basically where 1,234,567 would equal "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"

But I'm running into the compiled size of the formula error.

Now I've come up with a formula that only works for numbers between 100,000 and 999,999 (which should be fine for about 95% of cases I would be using it), but I'm interested in seeing if anyone has been able to do this in the 5,000 character limit before.
 
CASE(LEFT( RIGHT(TEXT(Offer_Price__c) ,6),1),

"1","One Hundred ",
"2","Two Hundred ",
"3","Three Hundred ",
"4","Four Hundred ",
"5","Five Hundred ",
"6","Six Hundred ",
"7","Seven Hundred ",
"8","Eight Hundred ",
"9","Nine Hundred ",
"10","Ten Hundred ",NULL)

&
IF(
AND(VALUE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2))>9,
VALUE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2))<20),

CASE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2),
"10","Ten Thousand ",
"11","Eleven Thousand ",
"12","Twelve Thousand ",
"13","Thirteen Thousand ",
"14","Fourteen Thousand ",
"15","Fifteen Thousand ",
"16","Sixteen Thousand ",
"17","Seventeen Thousand ",
"18","Eighteen Thousand ",
"19","Nineteen Thousand ",NULL),


CASE(LEFT(RIGHT(TEXT(Offer_Price__c),5),1),

"2","Twenty ",
"3","Thirty ",
"4","Forty ",
"5","Fifty ",
"6","Sixty ",
"7","Seventy ",
"8","Eighty ",
"9","Ninety ",NULL)

&

CASE(LEFT(RIGHT(TEXT(Offer_Price__c),4),1),
"0","Thousand",
"1","One Thousand ",
"2","Two Thousand",
"3","Three Thousand ",
"4","Four Thousand ",
"5","Five Thousand ",
"6","Six Thousand ",
"7","Seven Thousand ",
"8","Eight Thousand ",
"9","Nine Thousand ",NULL))

 
I'm currently using an Apex Class to generate a list of records owned by a specific User.
 
public TelemarketerDialing(){

        if(ApexPages.currentpage().getParameters().get('leadgenerator') == null)
                       {myParam = UserInfo.getUserId();}

        else{myParam = ApexPages.currentpage().getParameters().get('leadgenerator');}
        }

      public String myParam { get; set; }

I build a Visualforce page for Managers to basically click in to the list of any User using the Visualforce page URL of that individual LeadGenerator's page.
 
<td><a href="https://corere--c.na50.visual.force.com/apex/DoorKnockerPortal?leadgenerator=0056A000000f0af">Angel</a></td>

        <td><a href="https://corere--c.na50.visual.force.com/apex/TelemarketerPortal?leadgenerator=0056A000000e779">Antonio</a></td>

        <td><a href="https://corere--c.na50.visual.force.com/apex/TelemarketerPortal?leadgenerator=0056A000001IVgU">Ary</a></td>
I'm wondering if there's a way to user the UserID to display the name of the User you are viewing on the page.

Something like:
public String LeadGeneratorName = getUserInfo(myParam).UserName;
Is this possible?


 
I have a flow using the following Visualforce page:
 
<apex:page DocType="html-5.0" standardStylesheets="false" cache="false" showheader="false" standardcontroller="Contact">

<br/>
  <center>
   <font size="15" color="Orange" >Ramshackle Form</font>
  </center>
 <br/>
 
<body>
  <flow:interview name="RamshackleFlow" buttonLocation="bottom" finishLocation="{!URLFOR('/apex/thankyou')}"></flow:interview>
  
  
<style type="text/css">
.FlowText{
font-size: 300%;
line-height: 150px;
margin-left: 25px;}
.FlowNextBtn{
font-size: 300%;}
.FlowFinishBtn{
font-size: 300%;}

</style>

</body>
</apex:page>

I changed the font size of the Text Box field label to make it larger for a mobile device, but is there anyway to change the actual size of the text box itself? To use it on a mobile device, the user has to zoom in to each box to put the cursor there to start typing.

The flow is pretty much just 6 text boxes and then a save button.
 
We have a custom object for Sign Postage that we attach to Request Tickets for our agents to check out Inventory. When the dispatcher is selecting an Inventory (Record Type =  Sign Postage) Item to attach to the ticket to mark it as checked out, is there anyway we can limit the lookup field to only show the Sign Postage where a custom field Sign Status is marked as "Returned" rather than "Checked Out?"

This way we can guarantee that we wouldn't accidentally assign a piece of inventory for pickup that has already been checked out and is in the field.
I have an Apex Class that pulls Contacts that are assigned using a custom field to a specific Door Knocker:

 
public with sharing class DoorKnockerAssigned {
    
      public DoorKnockerAssigned(){
        if(ApexPages.currentpage().getParameters().get('leadgenerator') == null){myParam = UserInfo.getUserId();}
        else{myParam = ApexPages.currentpage().getParameters().get('leadgenerator');}
        }
    
      public String myParam { get; set; }
      public String sortOrder = ' Door_Knocker__r.Name ';
      public String ascendingOrDescending = ' ASC ';

public void sortByDoorKnocker() {this.sortOrder = ' Door_Knocker__r.Name '; if(ascendingOrDescending ==' ASC ') {ascendingorDescending = ' DESC ';} else{ascendingorDescending = ' ASC ';}}

String myRequestYesterday = ' SELECT id, Owner.Id,Owner.Name,Name, FirstName, LastName, Door_Knocker__r.Id,Assigned_Knock_Date__c'+
                  	  ' FROM Contact '+
                      ' WHERE Assigned_Knock_Date__c = YESTERDAY AND Door_Knocker__r.Id = \'' + myParam + '\' ORDER BY ';

List<Contact> DKYesterday; public List<Contact> getDKYesterday() {DKYesterday = new List<Contact>();DKYesterday = Database.query(myRequestYesterday + sortOrder + ascendingOrDescending);return DKYesterday;}

public void saveDKYesterday() {update DKYesterday;}

And I'm using the below Test Class:
 
@isTest
public class DoorKnockerAssignedTest {
    
    static testMethod void TestDKAssignedYesterday(){
            
    Account testaccount = new Account();
    testaccount.name = '123 Test Drive';
    testaccount.RecordTypeId = '0126A0000004Qo4';
    testaccount.APN__c = '123';
    testaccount.Foreclosure_Status__c = 'Auction';
    testaccount.Property_Zip_Code__c = '90001';
    insert testaccount;
         
    Contact testcontact = new Contact();
    testcontact.Contact_Stage__c = 'Dialing';
    testcontact.Phone_1__c = '6106754043';
    testcontact.Accountid = testaccount.id;
    testcontact.LastName = 'Dave';
    testcontact.OwnerId = '0056A000000HocdQAC';
    testcontact.Door_Knocker__c = UserInfo.getUserId();
    testcontact.RecordTypeId = '0126A0000004QlU';
    testcontact.Assigned_Knock_Date__c = date.valueOf('2018-02-26 11:00:00z');
    insert testcontact;
        
    system.debug(UserInfo.getUserId());
    system.debug(testcontact.OwnerId);
    system.debug(testcontact.Door_Knocker__c);
        
    ApexPages.currentPage().getParameters().put('leadgenerator',UserInfo.getUserId());
    DoorKnockerAssigned td = new DoorKnockerAssigned();
    system.debug(td.myParam);
    List<Contact> list1 = td.getDKYesterday();
    td.saveDKYesterday();
    system.assertEquals(1, list1.size());
    }

The test fails and says "System.QueryException: invalid ID field: null" but shouldn't it pull the UserID into the myParam?

Also my system.debug didn't show up in the log.

I got the test class to pass when I took out 
AND Door_Knocker__r.Id = \'' + myParam + '\'
from String myRequestYesterday so I know it's coming from that.

Any suggestions on how I can get this to work?


 
I have an Apex Class that pulls a UserID using getParameters. It works in the Visualforce page but in the Test Class it shows as "System.QueryException: invalid ID field: null"
 
public with sharing class TelemarketerDialing {
    
    public TelemarketerDialing(){
        if(ApexPages.currentpage().getParameters().get('leadgenerator') == null){
            myParam = UserInfo.getUserId();
        }
        else{
            myParam = ApexPages.currentpage().getParameters().get('leadgenerator');
        }
        }
    
    
      public String myParam {get; set;}
        
	  public String sortOrder = ' Last_Call__c ';
      public String ascendingOrDescending = ' ASC ';
    
      public String myRequest = ' SELECT id, Name, FirstName, LastName, Last_Call__c,Phone,Email,MobilePhone,Second_Property_Owner__c,Age__c,Equity_Dollar__c,'+
                      '	Actual_Sale_Date__c, Foreclosure_Status__c, Total_Calls_Live__c, Distance_from_FAIR_Program__c, Number_of_Phone_Numbers__c,Equity_Percentage__c,'+
            		  '	Property_Address__c,Property_City__c,Property_State__c,Property_Zip_Code__c,Verified_Lender__c,Prospecting_Criteria__c,'+
            	      '	Language_Spoken_at_Home__c,Total_Talk_Time_minutes__c,Combined_LTV_Ratio__c,'+
            		  ' Account.Id,Account.View_Note_URL__c,Account.New_Note_URL__c '+
                  	  ' FROM Contact '+
                      ' WHERE Contact_Stage__c = \'Dialing\' AND Prospecting_Criteria__c = TRUE AND OwnerId = \'' + myParam + '\' ORDER BY ';

List<Contact> contacts;
       public List<Contact> getContacts() {
   		contacts = new List<Contact>();
        contacts = Database.query(myRequest + sortOrder + ascendingOrDescending);
        return contacts;}

      public void saveAndReturn() {
        update contacts;
        }
}

With the following Test Class that I confirmed can Pass if I delete the getParameters section and replace the "myParam" in "myRequest" with "UserInfo.getUserId()".
 
@isTest
public class TelemarketerDialingTest {

    static testMethod void TestDialing(){
         
    Account testaccount = new Account();
    testaccount.name = '123 Test Drive';
    testaccount.RecordTypeId = '0126A0000004Qo4';
    testaccount.APN__c = '123';
    testaccount.Foreclosure_Status__c = 'Auction';
    testaccount.Property_Zip_Code__c = '90001';
    insert testaccount;
    system.debug(testaccount.id);
         
    Contact testcontact = new Contact();
    testcontact.Contact_Stage__c = 'Dialing';
    testcontact.Phone_1__c = '6106754043';
    testcontact.Accountid = testaccount.id;
    testcontact.LastName = 'Dave';
    testcontact.OwnerId = UserInfo.getUserId();
    testcontact.RecordTypeId = '0126A0000004QlU';
    insert testcontact;
    
    TelemarketerDialing td = new TelemarketerDialing();
    List<Contact> list1 = td.getContacts();
    td.saveAndReturn();
    system.assertEquals(1, list1.size());
    }
    
}

 
I have an Apex Class that generates a List of Events:
 
Public class AgentAppointmentsPast30 {
    
	String sortOrder = ' Who.Name ';
    String ascendingOrDescending = ' ASC ';
    String UserID = UserInfo.getUserId();
    String dateTimeFormat = DateTime.now().format('yyyy-MM-dd\'T\'hh:mm:ss\'Z\'');
    
    String myRequest = 'SELECT id, Owner.Id, type, subject, Decision_Made_by_Client__c, Appointment_Result__c, Reason_for_Cancellation_No_Show__c,'+
                ' WhoId, Who.Name, Appoint_Set_By__c, ActivityDateTime, No_Show_Cancelled_Disposition__c,Request_to_Shuffle__c,Contact_Name__r.Actual_Sale_Date__c, Contact_Name__r.Foreclosure_Status__c, Contact_Name__r.FAIR_Packet__c,'+ 
        	    ' Contact_Name__c, Contact_Name__r.Name, Contact_Name__r.Id, Contact_Name__r.Account.Property_Address__c,Contact_Name__r.Account.Name, Contact_Name__r.Account.Id'+
                ' FROM Event ' + 
                ' WHERE Owner.Id = \''+UserId+'\' And RecordTypeId = \'0126A0000004Qle\' AND ( ActivityDateTime = LAST_N_DAYS:30 OR (ActivityDateTime = TODAY And Type != \'Appointment - Booked\' And Type != \'Appointment - Confirmed\' ))'+
				' ORDER BY ';

    
    	public void sortByContact() 	{this.sortOrder = ' Who.Name ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
   		public void sortByActivityDateTime() 	{this.sortOrder = ' ActivityDateTime ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByType() 	{this.sortOrder = ' Type ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortBySubject() 	{this.sortOrder = ' Subject ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByOutcome() 	{this.sortOrder = ' Decision_Made_by_Client__c ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByOutcomeNotes() 	{this.sortOrder = ' Appointment_Result__c ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByNoShowDisp() 	{this.sortOrder = ' No_Show_Cancelled_Disposition__c ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByNoShowReason() 	{this.sortOrder = ' Reason_for_Cancellation_No_Show__c ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByAddress() 	{this.sortOrder = ' Contact_Name__r.Account.Name ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}
    
    	public void sortByPacket() 	{this.sortOrder = ' Contact_Name__r.FAIR_Packet__c ';
                                   if(ascendingOrDescending ==' ASC ') 
                                   {ascendingorDescending = ' DESC ';}
                                   else{ascendingorDescending = ' ASC ';}}



        List<Event> events;
     	public List<Event> getEvents() {
		events = new List<Event>();
        events = Database.query(myRequest + sortOrder + ascendingOrDescending);
        system.debug(events);
        return events;}

  		public void saveAndReturn() {
        update events;        
        }
}
I use the following test class:
 
@isTest
public class AgentAppointmentsPast30Test {
    
    static testMethod void TestApptPast30(){
        
        Account Testaccount = new account();
       	Testaccount.name = '123 Test Drive';
        Testaccount.RecordTypeId = '0126A0000004Qo4';
        Testaccount.APN__c = '123';
        Testaccount.OwnerId = '0056A000000HeMZ';
        insert Testaccount;
        
        Contact Testcontact = new contact();
        Testcontact.Lastname = 'Berenato';
        Testcontact.AccountId = Testaccount.Id;
        Testcontact.RecordTypeId = '0126A0000004QlU';
        Testcontact.OwnerId = '0056A000000HeMZ';
        insert Testcontact;
        
        Event Testevent = new event();
		Testevent.WhoId = Testcontact.id;        
        Testevent.Subject='Test';
        Testevent.type='Appointment - Booked';
        Testevent.RecordTypeId = '0126A0000004Qle';
        Testevent.ActivityDateTime=date.valueOf('2017-10-17 11:00:00z');
        Testevent.DurationInMinutes=120;
        insert Testevent;
        
        AgentAppointmentsPast30 at = new AgentAppointmentsPast30();
      	List<Event> list1 = at.getEvents();
        at.saveAndReturn();
        at.sortByActivityDateTime();
        at.sortByAddress();
        at.sortByContact();
        at.sortByNoShowDisp();
        at.sortByNoShowReason();
        at.sortByOutcome();
        at.sortByOutcomeNotes();
        at.sortByPacket();
        at.sortBySubject();
        at.sortByType();
        system.assertEquals(1, list1.size());
    }
}

I've never been able to have the event from the Test Class meet the criteria from the Apex Class, I always get the error:

System.AssertException: Assertion Failed: Expected: 1, Actual: 0

Even if I remove everything from the WHERE clause except the getUserId.

However, my Visualforce page in the Sandbox seems to be working fine, minus one major error.

If I assign two events to myself, I see them both in the Apex PageBlockTable.

User-added image

If I edit the event that is farther in the future, I click the Save Button I added to the table.

User-added image

The page reloads:

User-added image

The records are sorted by ActivityDateTime.

And then I manually refresh the page.

User-added image

And the event that was originally farther in the past gets automatically updated to match the new events edit.

As if the Save button is saving the new value to all of the records.

I'm totally stumped on how this is happening. I can't seem to find any workflow rule that would suggest this, and I've tested it several times outside of the PageBlockTable (in the Event's Detail page) and can't find proof that it updates both records independently.

Does anyone know what might be causing this, or why my Apex Class can't pass its test?



 
Is there anything I can do to the difference between two dates to convert it to a number that could be used in a large calculation (multiply by an integer or a currency field) in a field update for a currency field?
DATE(2019,7,1) – DATE(2019,5,1)

This by itself, as well as in the larger formula where this difference is used to calculate a pro-rated price, gives a "Syntax Error" for a Field Update to a Currency Field
I'm trying to set up a Validation rule to show an error if both of the below fields are filled in but not if both are blank. 

or( 
and(!isblank( Strategic_Partner__c ),!ISBLANK( Reseller__c )), 
or(!ISBLANK( Reseller__c) ,!isblank( Strategic_Partner__c )) 
)
If I have a column in an Apex:PageBlockTable for a Long Text Area, can I have the field Truncated to a certain number of characters with a Show More Link?
 
<apex:column width="300px">

            <apex:facet name="header">Description</apex:facet>

            <apex:outputText value="{!task.description}"/>

        </apex:column>

Some kind of href that will display the full field if clicked?
I'm running into an issue where I have too many buttons on the Lead page and they display in a drop-down list in Lightning. I want to use a Formula Field to open a Visualforce page, so I have this display on the top of the Lightning Lead view.

This is the button:
/apex/Application?leadid={!Lead.Id}&accid={! Lead.AccountId__c}

And the field would be:
HYPERLINK("/apex/Application?leadid="& Id & "accid=" & Account__r.Id , "Application")
I've seen people use "_target" but this forces a new tab in Google Chrome. Can I force a new Window, as well as set the height and width, all from a formula field?
 
Hi everyone,

I have a Visualforce page that checks for an existing Lookup record. If it does not exist, it runs a Flow Interview to create one, and if it does exist, it loads a Visualforce webform I made that uses Standard Controller for that "Application__c" custom object.

My only issue is I need the <flow: interview> FinishLocation to pull a variable ID from the record created in the Visual Workflow. How can I achieve this and reference it in the Visualforce Page?
 
public class FAIRAssistanceApplication {

     public FAIRAssistanceApplication (ApexPages.StandardController controller) {
    }
    public ID getAccId = System.currentPagereference().getParameters().get('var_AccountID');
    
    
    public Flow.Interview.NewFAIRAppAuto NewAppFlow{get;set;}
    public String getAccountId(){ return getAccId; }

    public ID AppId = NewAppFlow.var_AppID;
    
    public PageReference getAppId(){
        
        if(NewAppFlow != null) AppId = NewAppFlow.var_AppID;

        PageReference send = new PageReference('/' + NewAppFlow.var_AppID);
        send.setRedirect(true);
        return send;

    }
    
}
 
<apex:page showheader="false" standardController="Application__c" extensions="FAIRAssistanceApplication">



<apex:pageblock rendered="{!IF(ISBLANK(Application__c.Property_Account__c),TRUE,FALSE)}">
    <flow:interview name="NewFAIRAppAuto" interview="{!NewAppFlow}" finishLocation="{!AppId}')}">
    </flow:interview>
</apex:pageblock>




<apex:form rendered="{!IF(NOT(ISBLANK(Application__c.Property_Account__c)),TRUE,FALSE)}">
    <p>{!Application__c.Property_Account__r.Name}</p>
    <p>{!Application__c.Name}</p>
    <p>Employer: <apex:inputField value="{!Application__c.Employer_Position_1__c}"/></p>
<apex:commandButton id="saveBtn" value="Save" action="{!save}" />


</apex:form>

</apex:page>

 
I have a Visualforce Page to make a new record of a custom object we call "Notes"
<apex:page standardController="Note__c" showHeader="false">
    <apex:form id="theForm">
        <table>
            <tr>
                <th rowspan="2">Note Type</th>
                <th>Note Name</th>
                <th>Note Body</th>
                <th rowspan="2"><apex:commandButton value="Save" action="{!Save}" rerender="theForm" /></th>
            </tr>
            <tr>
                
                <th><apex:inputField value="{!Note__c.Name}"/></th>
                <th><apex:inputField value="{!Note__c.Content__c}"/></th>
            </tr>
        </table>
    </apex:form>
</apex:page>

I want to display a link to the URL off the Account, which is the Parent object in a Master-Detail Relationship field (Account__c).

Can I preopulate the Lookup Field with this value using a URL from the Account?

I've tried:

1. 
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__c=0016A000001p8GD
2.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__r.Id=0016A000001p8GD
3.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?00N6A000008PlNb=0016A000001p8GD
4.
https://corere--c.na50.visual.force.com/apex/NewNoteiFrame?Account__c=12345+Test+Drive

But none of them work. Any ideas?


 
I'm building out a link on the Lead to allow our salespeople to fill out an Application (Application__c) for a client. 

I want the URL to be linked to the Lead where:
 
https://corere--app--c.cs71.visual.force.com/apex/AssistanceApplication?acc={!Account__r.Id}

And then I'm writing a controller to basically determine if that attached Account has an existing Application to be updated or a new one to be created before page-load.
 
public class FAIRAssistanceApplication {

    public FAIRAssistanceApplication(){myParam = ApexPages.currentpage().getParameters().get('acc');}
    
    public String myParam { get; set; }    

    public List<Account> getAccount(){
        Map<String, Account> ExistingAppID = new Map<String, Account>();
        for (Account mapaccount : [Select FAIR_Assistance_Application__r.Id FROM Account WHERE Id = :myParam LIMIT 1])
        {ExistingAppID.put(mapaccount.FAIR_Assistance_Application__r.Id,mapaccount);}
        return ExistingAppID.values();}

    public String ExistingAppID { get; set; }   

    public void getAppId()
    {
        if(ExistingAppID != Null)
            
			{string AppId = ExistingAppID;}

        else{
        
        	Application__c NewApp = new Application__c();
            
        	NewApp.Property_Account__c = myParam;
        	NewApp.Name = 'Test';            
            Insert NewApp;

        	Account acc2  = [Select id,Name FROM Account WHERE Id = :myParam LIMIT 1];
			acc2.FAIR_Assistance_Application__c = NewApp.Id;
        	update acc2;
            
        	string AppId = NewApp.Id;
        }
    }
    
    public String AppId { get; set; }  
    
    public FAIRAssistanceApplication(ApexPages.StandardController controller) {
		ApexPages.currentPage().getParameters().put('id', AppId);
    }

}

The Account is linked to the Application by the Lookup field "Assistance_Application__c" and the Application is linked back to the Account with a Master-Detail field "Property_Account__c."

The Visualforce page loads and it will essentially be a stylized webform of <apex: inputField> for the StandardController "Application__c"

I loaded the Visualforce page and tested one save where no Application existed and one where it did exist and neither worked. They saved new Applications with only the fields in the InputFields being populated.
I found a simple collapisble table online: https://codepen.io/andornagy/pen/gaGBZz

And I wanted to use it in a Visualforce page. I copied a simplified version of it, first with the Static Resource I called "Collapisble Table"
 
$(document).ready(function() {
	$('[data-toggle="toggle"]').change(function(){
		$(this).parents().next('.hide').toggle();
	});
});

And then wrote the Visualforce page accordingly:
 
<apex:page showheader="false" sidebar="false">

<apex:includeScript value="{!$Resource.CollapsibleTable}"/>


<style>
table { 
    width: 750px; 
    border-collapse: collapse; 
    margin:50px auto;
    }

th { 
    background: #3498db; 
    color: white; 
    font-weight: bold; 
    }

td, th { 
    padding: 10px; 
    border: 1px solid #ccc; 
    text-align: left; 
    font-size: 18px;
    }

.labels tr td {
    background-color: #2cc16a;
    font-weight: bold;
    color: #fff;
}

.label tr td label {
    display: block;
}


[data-toggle="toggle"] {
    display: none;
}
</style>

<table>
    <tbody>
        <tbody class="labels">
            <tr>
                <td colspan="5">
                    <label for="accounting">Accounting</label>
                    <input type="checkbox" name="accounting" id="accounting" data-toggle="toggle"/>
                </td>
            </tr>
        </tbody>
        <tbody class="hide">
            <tr>
                <td>Australia</td>
                <td>$7,685.00</td>
                <td>$3,544.00</td>
                <td>$5,834.00</td>
                <td>$10,583.00</td>
            </tr>
            <tr>
                <td>Central America</td>
                <td>$7,685.00</td>
                <td>$3,544.00</td>
                <td>$5,834.00</td>
                <td>$10,583.00</td>
            </tr>
        </tbody>
    </tbody>
</table>

</apex:page>

It loads property but the click to collapse functionality is missing. This is probably something really simple I'm missing. 
I'm writing a formula to convert a Number Field into a Word.

Basically where 1,234,567 would equal "One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"

But I'm running into the compiled size of the formula error.

Now I've come up with a formula that only works for numbers between 100,000 and 999,999 (which should be fine for about 95% of cases I would be using it), but I'm interested in seeing if anyone has been able to do this in the 5,000 character limit before.
 
CASE(LEFT( RIGHT(TEXT(Offer_Price__c) ,6),1),

"1","One Hundred ",
"2","Two Hundred ",
"3","Three Hundred ",
"4","Four Hundred ",
"5","Five Hundred ",
"6","Six Hundred ",
"7","Seven Hundred ",
"8","Eight Hundred ",
"9","Nine Hundred ",
"10","Ten Hundred ",NULL)

&
IF(
AND(VALUE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2))>9,
VALUE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2))<20),

CASE(LEFT(RIGHT(TEXT(Offer_Price__c),5),2),
"10","Ten Thousand ",
"11","Eleven Thousand ",
"12","Twelve Thousand ",
"13","Thirteen Thousand ",
"14","Fourteen Thousand ",
"15","Fifteen Thousand ",
"16","Sixteen Thousand ",
"17","Seventeen Thousand ",
"18","Eighteen Thousand ",
"19","Nineteen Thousand ",NULL),


CASE(LEFT(RIGHT(TEXT(Offer_Price__c),5),1),

"2","Twenty ",
"3","Thirty ",
"4","Forty ",
"5","Fifty ",
"6","Sixty ",
"7","Seventy ",
"8","Eighty ",
"9","Ninety ",NULL)

&

CASE(LEFT(RIGHT(TEXT(Offer_Price__c),4),1),
"0","Thousand",
"1","One Thousand ",
"2","Two Thousand",
"3","Three Thousand ",
"4","Four Thousand ",
"5","Five Thousand ",
"6","Six Thousand ",
"7","Seven Thousand ",
"8","Eight Thousand ",
"9","Nine Thousand ",NULL))

 
I'm currently using an Apex Class to generate a list of records owned by a specific User.
 
public TelemarketerDialing(){

        if(ApexPages.currentpage().getParameters().get('leadgenerator') == null)
                       {myParam = UserInfo.getUserId();}

        else{myParam = ApexPages.currentpage().getParameters().get('leadgenerator');}
        }

      public String myParam { get; set; }

I build a Visualforce page for Managers to basically click in to the list of any User using the Visualforce page URL of that individual LeadGenerator's page.
 
<td><a href="https://corere--c.na50.visual.force.com/apex/DoorKnockerPortal?leadgenerator=0056A000000f0af">Angel</a></td>

        <td><a href="https://corere--c.na50.visual.force.com/apex/TelemarketerPortal?leadgenerator=0056A000000e779">Antonio</a></td>

        <td><a href="https://corere--c.na50.visual.force.com/apex/TelemarketerPortal?leadgenerator=0056A000001IVgU">Ary</a></td>
I'm wondering if there's a way to user the UserID to display the name of the User you are viewing on the page.

Something like:
public String LeadGeneratorName = getUserInfo(myParam).UserName;
Is this possible?