• Robert Robinson
  • NEWBIE
  • 134 Points
  • Member since 2015
  • Manager, Salesforce Application
  • Welltower


  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 62
    Replies
I have two Objects (Deal__c and Property__c) that I would like to join in a related list. Deal and Property are not related to each other but they do have a junction object Deal_Property__c (Deal is the master of Deal Property, and Deal Property has Property as a lookup field). I want to create a controller extension that for Deal A lists Properties 1, 2 and 3. I think this is possible but I cannot come up with the correct syntax. I've searched the documentation and Trailhead, but cannot quite find what I am looking for. Any ideas? Thanks.
I have users who are updating Tasks (Activities) on a custom object (Deal__c), and they want a function to copy the data from the Task fields on the Deal to the Task fields on the related Account, as there are often two different audiences for the Task update. I would create a new checkbox field for the Deal Task Layout (Copy to Account): my question is which would be the better tool to use when the Deal Task box is checked: Process Builder (which I know has some limitations) or an Apex trigger? Thanks.
I am creating a test class for an Apex class. My code:

@isTest
public class LsUnitListTest
{
    static testMethod void testLsUnitListPage()
    {
    
        Lease__c objLease = new Lease__c(Name = 'Test Lease');
        insert objLease;
       
        List<Lease_Unit_Association__c> lstUnit = new List<Lease_Unit_Association__c>{  new Unit__c(    Unit__c = 'Test Unit1', Unit__c = objLease.ID,  Property_Unit__r.Unit_Status_Code__c = 'N'),


I am encountering the following error:
Error: Compile Error: Invalid field Unit__c for SObject Unit__c at line 10 column 115

I am not quite sure what it is telling me. Do I have an invalid field type in the test? I get the feeling it is something obvious. Any help would be appreciated. Thanks.
I am using an apex:Pageblock with a 6 column panelgrid to create pagination for a custom related list. I have everything working ok except for 1 piece. I created a "Go to List" function that pulls up the list of related records. So that this will appear, I am using the apes:commandLink value function as follows:
  <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>
This block gives users these options: Go to List  Next  Last on page 1, Go to List First Previous Next Last on page 2 and so on. On the last page, the user sees First  Previous as options 
I think this is where i painted myself into a corner; the Go to List option appears only as long as there is a "Next" option; on the last page (no next), Go to List is not an option.

Here is the pertinent block of code:
 </apex:pageBlockButtons> 
      <apex:panelGrid columns="6" id="linkPanel">
        <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>       
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!first}" value="First" rendered="{!units.hasPrevious}"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!previous}" rendered="{!units.hasPrevious}" value="Previous"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!next}" rendered="{!units.hasNext}" value="Next"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!last}" rendered="{!units.hasNext}" value="Last"/>
        <apex:outputText id="pNum">{!IF(noofrecords=0,'No records to display',TEXT((units.pageNumber * size)+1-size)+'-'+IF((units.pageNumber * size)>noOfRecords, TEXT(noOfRecords),TEXT((units.pageNumber * size)))+' of '+ TEXT(noofrecords))}</apex:outputText>
        <apex:outputPanel style="color:#4AA02C;font-weight:bold">
        <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>
        </apex:outputPanel>
      </apex:PanelGrid>
    </apex:pageBlock>

Is there another function that I can use to ensure that the Go to Link option appears on the last page of the list? Thanks.
This is a strange one. I cannot log into developer.salesforce.com on my PC. I am sending this from my iPad. Has anyone else experienced this?
I have created Apex Class #1 which filters out a particular data value, and created a test for that class. I am able to get 95% code coverage.
I then created Apex Class #2 which includes the data value exclused from Class #1. I then created a test for Class #2, but I get 0% code coverage. 
Here is Apex Class #2:
/*Controller class for the PropInactiveUnitRelatedList visualforce page used inline on Property layouts
to show only inactive Units related to the Property
*/
public class InactiveUnitList{
    public Integer noOfRecords{get; set;}
    public Integer size{get;set;}
    public boolean showHeaderSideBar{get;set;}
    public String redirectUrl {get;set;}
    ApexPages.StandardController controller;
   private boolean fullscreen;
   public InactiveUnitList(ApexPages.StandardController controller) {
       this.controller = controller;
       //check if page needs to be opened in full screen mode
       String value = ApexPages.currentPage().getParameters().get('fullscreen');
       if(String.isNotBlank(value) && value == 'true'){
           fullscreen = true;
           showHeaderSideBar = true;
       }else{
            fullscreen = false;
            showHeaderSideBar = false;   
       }
   }
    public ApexPages.StandardSetController units{ 
        get{
            if(units == null){
                if(fullscreen) size = 100;
                if(size==null) size=5;
                units = new ApexPages.StandardSetController(Database.getQueryLocator(
                  [Select Name, Unit_Number__c, RSF__c, Parent_Tenant__r.name, Tenant__r.name, Unit_Status_Code__c, Current_Lease__r.name, RecordType.name 
                  from Unit__c 
                  where Property__c = :controller.getId() 
                  AND Unit_Status_Code__c = 'N']));
                units.setPageSize(size);
                noOfRecords = units.getResultSize();
            }
            return units;
        }
        set;
    }
    public Boolean hasNext {
        get {
            return units.getHasNext();
        }
        set;
    }
    public Boolean hasPrevious {
        get {
            return units.getHasPrevious();
        }
        set;
    }
    public Integer pageNumber {
        get {
            return units.getPageNumber();
        }
        set;
    }
    public void first() {
        units.first();
    }
    public void last() {
        units.last();
    }
    public void previous() {
        units.previous();
    }
    public void next() {
        units.next();
    }
    public PageReference refreshPageSize() {
         units.setPageSize(size);
         return null;
    }
    public void showAll(){
        redirectUrl = '/apex/PropUnitRelatedList?id='+controller.getId()+'&fullscreen=true';
    }
    public void saveUnits(){
        try {
            units.save();
        } catch (Exception e) {
            ApexPages.addMessages(e);
        }
    }
}

And here is the test for Class #2:
@isTest
public class InactiveUnitListTest
{
    static testMethod void testInactiveUnitListPage() 
    {
    
        Property__c objProperty = new Property__c(Name = 'Test Prop');
        insert objProperty;
        
        /* Assuming Name is not an auto number here. Please populate all the required field value pairs.*/
        List<Unit__c> lstUnit = new List<Unit__c>{  new Unit__c(    BU_Unit__c = 'Test Unit1', Property__c = objProperty.Id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit2', Property__c = objProperty.Id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit3', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit4', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit5', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit6', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit7', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit8', Property__c = objProperty.id, 
                                                                   Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit9', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N'),
                                                       new Unit__c(    BU_Unit__c = 'Test Unit10', Property__c = objProperty.id, 
                                                                    Unit_Status_Code__c = 'N')                                                                 
                                                            };
        
        insert lstUnit;
        
         // replace YOURPAGENAME with actual page name
        PageReference pageRef = Page.PropUnitRelatedList;
        Test.setCurrentPage(pageRef);
        ApexPages.currentPage().getParameters().put('fullscreen','true');
        
        ApexPages.StandardController sc = new ApexPages.StandardController(objProperty);
        
        // now pass it to the extension
        UnitList stdController = new UnitList(sc);
        
        ApexPages.StandardSetController setCon = stdController.units;
        
        // verify if 10 rows returned
        system.assertEquals(0, stdController.noOfRecords);
        
        
        Boolean blnHasNext = stdController.hasNext;
        Boolean blnHasPrevious = stdController.hasPrevious;
        system.assertEquals(1, stdController.pageNumber);
        
        stdController.next();
        //system.assertEquals(2, stdController.pageNumber);
        stdController.last();
        //system.assertEquals(2, stdController.pageNumber);
        stdController.previous();
        //system.assertEquals(2, stdController.pageNumber);
        stdController.first();
        //system.assertEquals(1, stdController.pageNumber);
        
        stdController.refreshPageSize();
        stdController.showAll();
        stdController.saveUnits();
      
        
        // turn off fullscreen
        ApexPages.currentPage().getParameters().put('fullscreen','false');
        sc = new ApexPages.StandardController(objProperty);
        
        // now pass it to the extension
        stdController = new UnitList(sc);
    }
}

Class #1 and Class #2  are so similar; only 1 line of code is different. I must be missing something obvious; please advise.
I am running a SOQL query. In it, I want to display the name of the Record Type rather than the ID number. If I create a query that includes:
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:

ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks. 
Earlier this year I asked about placing multiple markers on a Google map. The resulting map earned raves. Now the next step is providing different colored markers based on different criteria. The test group is 4 colors I know that I will need to use If-else logic something like
If (portfoilio1 = value 1), marker 1
else if (portfoilio2 = value 2), marker 2
else if (portfoilio3 = value 3), marker 3
else (portfoilio4 = value 4), marker 4
Hovever, I am not placing the statement correctly, as I am seeing errors like "If statement cannot be used inside <apex:map> in the markup". I am wordering if the If-else statement needs to be placed outside of the <apex:map> section.
The Visualforce page (that works for 1 color) is shown below (stanza that identifies the markers in bold):

<apex:page sidebar="false" showHeader="false" standardController="Market__c" extensions="MSAProperty" >
   <!-- This page must be accessed with an Market Id in the URL. For example:  
       https://cs41.salesforce.com/apex/rrmultipropmap?id=a1255000002hr4G -->
  <apex:pageBlock >
    <apex:pageBlockSection Title="Properties in {!Market__c.Name} MSA {!Market__c.MSA_Code__c}">  
  <!-- Section for MSA list -->     
      <apex:pageBlockTable value="{!mprops}" var="mp">
       <apex:column headerValue="Property Name">
              <apex:outputLink value="/{!mp['Id']}" title="{!mp['Name']}" target="_top">{!mp['Name']}</apex:outputLink>
       </apex:column>   
       <apex:column value="{!mp['Portfolio__c']}"/>
       <apex:column value="{!mp['Address__c']}"/>
       <apex:column value="{!mp['City__c']}"/>
       <apex:column value="{!mp['State__c']}"/>
       <apex:column value="{!mp['Zip__c']}"/>
      </apex:pageBlockTable>
 <!-- Section for map features -->
   <apex:map width="600px" height="400px" mapType="hybrid"
    center="{!Market__c.City__c},{!Market__c.State__c}">
     <!-- Add markers for Properties within MSA -->    
     <apex:repeat value="{!mprops}" var="mp">
      <apex:mapMarker title="{! mp.Name }"
       position="{'latitude':{!mp.Geolocation__Latitude__s},'longitude':{!mp.Geolocation__Longitude__s}}"
       icon="{!URLFOR($Resource.HCNMarker4) }">

 
      <!-- Add info window with Property details -->    
      <apex:mapInfoWindow >
            <apex:outputPanel layout="block" style="font-weight: bold;">
              <apex:outputText >{! mp.Name }</apex:outputText>
            </apex:outputPanel>
            <apex:outputPanel layout="block">
              <apex:outputText >{! mp.Portfolio__c }</apex:outputText>
            </apex:outputPanel>   
             <apex:outputPanel layout="block">
              <apex:outputText >{! mp.Address__c }</apex:outputText>
            </apex:outputPanel>               
            <apex:outputPanel layout="block">
              <apex:outputText >{! mp.City__c }, {! mp.State__c }</apex:outputText>
            </apex:outputPanel>               
          </apex:mapInfoWindow>
          
        </apex:mapMarker>
     </apex:repeat>
    </apex:map>
   </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>


I am likely missing something basic; if someone could point out what, I would be grateful. Thanks.
Basic question I am sure...when I run the User Login report, I see users with their browsers and client type - browser. However, I also see about 1/3 of the user login entries either having "Unknown" or "Unknown Webkit Browser" paired with the Client Type of "OAuth". Could someone shed light on what these entries are? Thank you.
I have two custom Objects Properties and Units. I am attempting to create a URL link from a Unit page which reference a field (BU Code) on the Property object. Using the Custom Button or Link Page, my formula looks like this:
https://vantage.welltower.com/v2/mob#property/{!Property__c.BU_Code__c}
The formula saves but does not insert the desired value into the URL (note that this URL worked with a different value which has changed)
The formula shown above runs contrary to the standard SOQL query, because the query would be written
"Select Property__r.BU_Code__c from Unit__c"
However, when using the Custom Button tools, one selects the Field Type (Object) and Field, and the formula returned does not include the related reference (r) that is used in the SOQL statement.
I am wondering if the rules are indeed different for custom button formulas and related references cannot be used?
General question: Standard Salesforce pages provide the ability to resequence a form's contents when a header is clicked (once for ascending, a second time for descending). when buildin a Visualforce page, what is the code used to provide that resequencing functionality? I would think it would be an addition to the columnHeader value portion of the apex code, but I can not find the specific coding. Something that would fit inside:
<apex:column headerValue="Property Name">
      <apex:outputLink value="/{!mp['Id']}" title="{!mp['Name']}" target="_top">{!mp['Name']}
      </apex:outputLink>
</apex:column>

Any ideas?
I have created a map with multiple locations. From what I am reading, there is a governor limit of 10 geocoded address lookups per map. For some maps, I do have more than 10 locations. Per the documentation, "To display more markers, provide position values that do not require geocoding (like address or lat/long data). Wondering if anyone has done this. Thanks.
I want to change colors for the markers on a Google map. I saw the Summer '15 release notes ("Customize Visualforce Maps with Custom Markers") so I gave it a shot. I created a custom marker, saved it as a jpg, then saved the jpg as a static resource. I then added the follofing line to my Visualforce page:
...icon="{! URLFOR($Resource.HCNMarker, 'marker.jpg') }" />
The VF page saved, but when I pulled up a sample, the markers do not appear on the map. I went back and mispelled the name of the static resource and tried to save. I then received an error on the VF page, which tells me that the code is seeing the static resource; i am just not seeing the markers. Is there anything else I am missing?
I am creating a map that pinpoints multiple locations (multiple locations in a MSA). The map involves two custom objects: Markets (MSA) and Properties. I have created the Visualforce Page and a related extension (both included below). The output should be split into two sections: the first (left) will be a list of the properties in the MSA, and the second block (right) will be the map itself. The VF Page and the extension compile without issue. When I run the page for an MSA value, the list appears on the left; however, the map does not appear. I must be missing something.

Visualforce Page
<apex:page sidebar="false" showHeader="false" standardController="Market__c" extensions="MSAProperty" >
  <!-- This page must be accessed with an Market Id in the URL. For example: 
       https://cs41.salesforce.com/apex/rrmultipropmap?id=a1255000002hr4G -->
  <apex:pageBlock >
    <apex:pageBlockSection Title="Properties in {!Market__c.Name} MSA"> 
      <apex:pageBlockTable value="{!mprops}" var="mp">
       <apex:column value="{!mp['Name']}"/>
       <apex:column value="{!mp['Address__c']}"/>
       <apex:column value="{!mp['City__c']}"/>
       <apex:column value="{!mp['State__c']}"/>
       <apex:column value="{!mp['Zip__c']}"/>
   <apex:map width="600px" height="400px" mapType="roadmap"
    center="{!mp.Address__c},{!mp.City__c},{!mp.State__c},{mp.Zip__c}">
     <apex:repeat value="{!mprops}" var="mp">
       <apex:mapMarker title="{! mp.Name }"
      position="{!mp.Address__c},{!mp.City__c},{!mp.State__c},{mp.Zip__c}"/>
     </apex:repeat>
   </apex:map>
     </apex:pageBlockTable>
    </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>

Apex Controller Extension
/*Controller class for the Multimktmap visualforce page used inline on Market layouts
to show only active Units related to the Property
*/
public class MSAProperty{
    public MSAProperty() {
    }
   public List<Property__c> mprops {get;set;}
   public MSAProperty(ApexPages.StandardController cont) {
      String ID = cont.getId();
      mprops = [Select Name, Address__c, City__c, State__c, Zip__c 
                  from Property__c 
                  where Market__c = :cont.getId()];
              }
        }
 
I have a custom field (Tenant__c) which represents a lookup value for Accounts. I am trying to write a SOQL query to extract the names in this field, rather than the 18 character case safe value. I know when you are trying to to pull the name for the Account field, you express it as "Account.Name", but I cannot get the correct syntax for this custom field (Tenant.Name__c does not work). What is the correct syntax in this situation? Thank you.
I am trying to create a test class for a controller extenstion that performs a SOQL query and sets up the VF page for pagination. Most test class examples that I have found have been for insertion of records, not data selection and listing. Can someone provide suggestions on the controller extension shown below? Thanks. 

public class DealList{    
 public Integer noOfRecords{get; set;}    
 public Integer size{get;set;}     
 public boolean showHeaderSideBar{get;set;}     
 public String redirectUrl {get;set;}     
ApexPages.StandardController controller;    
private boolean fullscreen;    
public DealList(ApexPages.StandardController controller) {        
this.controller = controller;       
 //check if page needs to be opened in full screen mode        
String value = ApexPages.currentPage().getParameters().get('fullscreen');        
if(String.isNotBlank(value) && value == 'true'){            
fullscreen = true;            
showHeaderSideBar = true;        }else{             
fullscreen = false;             
showHeaderSideBar = false;           
   }    
}     
public ApexPages.StandardSetController deals{          
get{             
if(deals == null){                 
if(fullscreen) size = 100;                 
if(size==null) size=5;                 
deals = new ApexPages.StandardSetController(Database.getQueryLocator( [Select Name, Location__c, Asset_Type__c, Underwriter__c, Amount__c, Stage__c, Estimated_Close__c, Closing_Probability_Category__c                    
    from Deal__c                     
     where Account_Name__c = :controller.getId()                    
       and Status__c = 'Open']));                 
      deals.setPageSize(size);                 
       noOfRecords = deals.getResultSize();             
}             
return deals;         
}         
set;     
}     
public Boolean hasNext {         
get {             
return deals.getHasNext();         
}         
set;     
}     
public Boolean hasPrevious {         
get {             
return deals.getHasPrevious();        
 }         
set;     
}     
public Integer pageNumber {         
get {             
return deals.getPageNumber();        
 }         
set;     
}     
public void first() {
        deals.first();     
}     
public void last() {         
deals.last();     
}     
public void previous() {         
deals.previous();    
 }     
public void next() {         
deals.next();    
 }     
public PageReference refreshPageSize() {          
deals.setPageSize(size);          
return null;     
}     
public void showAll(){         
redirectUrl = '/apex/AcctDealRelatedList?id='+controller.getId()+'&fullscreen=true';     
}     
public void saveDeals(){         
try {             
deals.save();         

catch (Exception e) {             
ApexPages.addMessages(e);         
}     
}
}
I am at the final step of recreating a filtered Related List using a Standard Controller and an extension. Since I am not using the standard related list, I am not able to make use of the features baked into the related list functionality. I have managed to replicate all needed functions except one: the commandLink function used to create the "Show x more » | Go to list (x) »" links. Has anyone used this functionality? If so, please advise. Thanks. 
I have a custom object (Properties__c) that is a related list item for Accounts. Since some of the properties have been sold, users only want to see the Active Properties in the related list for Acccounts. I have attempted to use the Account Standard Controller in Visualforce along with an extension to accomplish this:
My Visualforce page markup is as follows:
<apex:page sidebar="false" showHeader="false" StandardController="Account" extensions="ActProp">
  <apex:pageBlock title="List of Properties">
 <apex:pageBlockTable value="{!props}" var="a">
        <apex:column value="{!a.Name}"/>
        <apex:column value="{!a.Asset_Type__c}"/>
        <apex:column value="{!a.RecordType.Name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
 </apex:page> 


My Controller extension is as follows:
public class ActProp{
   public ActProp(ApexPages.StandardController cont) {}
   List<Property__c> props = [Select Name, RecordType.Name, Asset_Type__c from Property__c where Status__c ='1'];
      public List<Property__c> getprops(){
      return props;
      } 
}


My Visualforce page an custom controller both save with no issues; however, when I run the Page with a valid account (one with properties), the only thing that is returned is the "List of Properties" Block Title. I have read through the VF documentation and viewed related YouTube videos to try to figure this out. I know that I am thisclose, but am missing an element. Any assistance would be greatly appreciated. Thank you.
I have created a Visualforce Page to mimic a related list for a custom object (Properties). The purpose is to add a filter to filter out properties with a status (Status__c) = "Active". To this point, I have been able to mimic the related list section of the Account object using this code:
<apex:page sidebar="false" showHeader="true" StandardController="Account">
   <apex:relatedList list="Properties_Operated__r">
   </apex:relatedList>
</apex:page>
I have been able to add the Visualforce page as a section of the page layout; it looks good and functions perfectly. I am now trying to add the code to filter by Status__c = "Active". So far, my attempts have been unsuccessful. Could someone advise as to the proper coding to use? Thank you. 
We have created an Object called "Markets" following the standard MSA codes. Within each market, we have several accounts. I have had success mapping single accounts using a Visual Force page, but now I am looking to map multiple accounts within an MSA zone. Has anyone come up with a way to map multiple points in Visual Force? I am trying to avoid pay apps like Geopointe or MapAnything. Thanks.
I am using an apex:Pageblock with a 6 column panelgrid to create pagination for a custom related list. I have everything working ok except for 1 piece. I created a "Go to List" function that pulls up the list of related records. So that this will appear, I am using the apes:commandLink value function as follows:
  <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>
This block gives users these options: Go to List  Next  Last on page 1, Go to List First Previous Next Last on page 2 and so on. On the last page, the user sees First  Previous as options 
I think this is where i painted myself into a corner; the Go to List option appears only as long as there is a "Next" option; on the last page (no next), Go to List is not an option.

Here is the pertinent block of code:
 </apex:pageBlockButtons> 
      <apex:panelGrid columns="6" id="linkPanel">
        <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>       
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!first}" value="First" rendered="{!units.hasPrevious}"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!previous}" rendered="{!units.hasPrevious}" value="Previous"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!next}" rendered="{!units.hasNext}" value="Next"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!last}" rendered="{!units.hasNext}" value="Last"/>
        <apex:outputText id="pNum">{!IF(noofrecords=0,'No records to display',TEXT((units.pageNumber * size)+1-size)+'-'+IF((units.pageNumber * size)>noOfRecords, TEXT(noOfRecords),TEXT((units.pageNumber * size)))+' of '+ TEXT(noofrecords))}</apex:outputText>
        <apex:outputPanel style="color:#4AA02C;font-weight:bold">
        <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>
        </apex:outputPanel>
      </apex:PanelGrid>
    </apex:pageBlock>

Is there another function that I can use to ensure that the Go to Link option appears on the last page of the list? Thanks.
Just a quick comment (correction): In the "Navigating and Customizing Salesforce" Module, under "Searching for Records", first sentence: "You" is used twice. Not sure where else to post needed corrections...
I have two Objects (Deal__c and Property__c) that I would like to join in a related list. Deal and Property are not related to each other but they do have a junction object Deal_Property__c (Deal is the master of Deal Property, and Deal Property has Property as a lookup field). I want to create a controller extension that for Deal A lists Properties 1, 2 and 3. I think this is possible but I cannot come up with the correct syntax. I've searched the documentation and Trailhead, but cannot quite find what I am looking for. Any ideas? Thanks.
I am creating a test class for an Apex class. My code:

@isTest
public class LsUnitListTest
{
    static testMethod void testLsUnitListPage()
    {
    
        Lease__c objLease = new Lease__c(Name = 'Test Lease');
        insert objLease;
       
        List<Lease_Unit_Association__c> lstUnit = new List<Lease_Unit_Association__c>{  new Unit__c(    Unit__c = 'Test Unit1', Unit__c = objLease.ID,  Property_Unit__r.Unit_Status_Code__c = 'N'),


I am encountering the following error:
Error: Compile Error: Invalid field Unit__c for SObject Unit__c at line 10 column 115

I am not quite sure what it is telling me. Do I have an invalid field type in the test? I get the feeling it is something obvious. Any help would be appreciated. Thanks.
I am using an apex:Pageblock with a 6 column panelgrid to create pagination for a custom related list. I have everything working ok except for 1 piece. I created a "Go to List" function that pulls up the list of related records. So that this will appear, I am using the apes:commandLink value function as follows:
  <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>
This block gives users these options: Go to List  Next  Last on page 1, Go to List First Previous Next Last on page 2 and so on. On the last page, the user sees First  Previous as options 
I think this is where i painted myself into a corner; the Go to List option appears only as long as there is a "Next" option; on the last page (no next), Go to List is not an option.

Here is the pertinent block of code:
 </apex:pageBlockButtons> 
      <apex:panelGrid columns="6" id="linkPanel">
        <apex:commandLink value="Go to List" rendered="{!units.hasNext}" action="{!showAll}"/>       
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!first}" value="First" rendered="{!units.hasPrevious}"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!previous}" rendered="{!units.hasPrevious}" value="Previous"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!next}" rendered="{!units.hasNext}" value="Next"/>
        <apex:commandLink status="fetchStatus" reRender="pblock" action="{!last}" rendered="{!units.hasNext}" value="Last"/>
        <apex:outputText id="pNum">{!IF(noofrecords=0,'No records to display',TEXT((units.pageNumber * size)+1-size)+'-'+IF((units.pageNumber * size)>noOfRecords, TEXT(noOfRecords),TEXT((units.pageNumber * size)))+' of '+ TEXT(noofrecords))}</apex:outputText>
        <apex:outputPanel style="color:#4AA02C;font-weight:bold">
        <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>
        </apex:outputPanel>
      </apex:PanelGrid>
    </apex:pageBlock>

Is there another function that I can use to ensure that the Go to Link option appears on the last page of the list? Thanks.
This is a strange one. I cannot log into developer.salesforce.com on my PC. I am sending this from my iPad. Has anyone else experienced this?
I am running a SOQL query. In it, I want to display the name of the Record Type rather than the ID number. If I create a query that includes:
Select .... RecordTypeID, I get the record type ID; however, when I use "RecordTypeID.name" or "RecordTypeID__r.name", I get this error:

ERROR at Row:1:Column:121
Didn't understand relationship 'RecordTypeID__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.


I have the feeling that the Record Type name has different properties, but I am not using the correct syntax to display the name. What am I missing. Thanks. 
General question: Standard Salesforce pages provide the ability to resequence a form's contents when a header is clicked (once for ascending, a second time for descending). when buildin a Visualforce page, what is the code used to provide that resequencing functionality? I would think it would be an addition to the columnHeader value portion of the apex code, but I can not find the specific coding. Something that would fit inside:
<apex:column headerValue="Property Name">
      <apex:outputLink value="/{!mp['Id']}" title="{!mp['Name']}" target="_top">{!mp['Name']}
      </apex:outputLink>
</apex:column>

Any ideas?
I want to change colors for the markers on a Google map. I saw the Summer '15 release notes ("Customize Visualforce Maps with Custom Markers") so I gave it a shot. I created a custom marker, saved it as a jpg, then saved the jpg as a static resource. I then added the follofing line to my Visualforce page:
...icon="{! URLFOR($Resource.HCNMarker, 'marker.jpg') }" />
The VF page saved, but when I pulled up a sample, the markers do not appear on the map. I went back and mispelled the name of the static resource and tried to save. I then received an error on the VF page, which tells me that the code is seeing the static resource; i am just not seeing the markers. Is there anything else I am missing?
I am creating a map that pinpoints multiple locations (multiple locations in a MSA). The map involves two custom objects: Markets (MSA) and Properties. I have created the Visualforce Page and a related extension (both included below). The output should be split into two sections: the first (left) will be a list of the properties in the MSA, and the second block (right) will be the map itself. The VF Page and the extension compile without issue. When I run the page for an MSA value, the list appears on the left; however, the map does not appear. I must be missing something.

Visualforce Page
<apex:page sidebar="false" showHeader="false" standardController="Market__c" extensions="MSAProperty" >
  <!-- This page must be accessed with an Market Id in the URL. For example: 
       https://cs41.salesforce.com/apex/rrmultipropmap?id=a1255000002hr4G -->
  <apex:pageBlock >
    <apex:pageBlockSection Title="Properties in {!Market__c.Name} MSA"> 
      <apex:pageBlockTable value="{!mprops}" var="mp">
       <apex:column value="{!mp['Name']}"/>
       <apex:column value="{!mp['Address__c']}"/>
       <apex:column value="{!mp['City__c']}"/>
       <apex:column value="{!mp['State__c']}"/>
       <apex:column value="{!mp['Zip__c']}"/>
   <apex:map width="600px" height="400px" mapType="roadmap"
    center="{!mp.Address__c},{!mp.City__c},{!mp.State__c},{mp.Zip__c}">
     <apex:repeat value="{!mprops}" var="mp">
       <apex:mapMarker title="{! mp.Name }"
      position="{!mp.Address__c},{!mp.City__c},{!mp.State__c},{mp.Zip__c}"/>
     </apex:repeat>
   </apex:map>
     </apex:pageBlockTable>
    </apex:pageBlockSection>
  </apex:pageBlock>
</apex:page>

Apex Controller Extension
/*Controller class for the Multimktmap visualforce page used inline on Market layouts
to show only active Units related to the Property
*/
public class MSAProperty{
    public MSAProperty() {
    }
   public List<Property__c> mprops {get;set;}
   public MSAProperty(ApexPages.StandardController cont) {
      String ID = cont.getId();
      mprops = [Select Name, Address__c, City__c, State__c, Zip__c 
                  from Property__c 
                  where Market__c = :cont.getId()];
              }
        }
 
I have a custom field (Tenant__c) which represents a lookup value for Accounts. I am trying to write a SOQL query to extract the names in this field, rather than the 18 character case safe value. I know when you are trying to to pull the name for the Account field, you express it as "Account.Name", but I cannot get the correct syntax for this custom field (Tenant.Name__c does not work). What is the correct syntax in this situation? Thank you.
I am trying to create a test class for a controller extenstion that performs a SOQL query and sets up the VF page for pagination. Most test class examples that I have found have been for insertion of records, not data selection and listing. Can someone provide suggestions on the controller extension shown below? Thanks. 

public class DealList{    
 public Integer noOfRecords{get; set;}    
 public Integer size{get;set;}     
 public boolean showHeaderSideBar{get;set;}     
 public String redirectUrl {get;set;}     
ApexPages.StandardController controller;    
private boolean fullscreen;    
public DealList(ApexPages.StandardController controller) {        
this.controller = controller;       
 //check if page needs to be opened in full screen mode        
String value = ApexPages.currentPage().getParameters().get('fullscreen');        
if(String.isNotBlank(value) && value == 'true'){            
fullscreen = true;            
showHeaderSideBar = true;        }else{             
fullscreen = false;             
showHeaderSideBar = false;           
   }    
}     
public ApexPages.StandardSetController deals{          
get{             
if(deals == null){                 
if(fullscreen) size = 100;                 
if(size==null) size=5;                 
deals = new ApexPages.StandardSetController(Database.getQueryLocator( [Select Name, Location__c, Asset_Type__c, Underwriter__c, Amount__c, Stage__c, Estimated_Close__c, Closing_Probability_Category__c                    
    from Deal__c                     
     where Account_Name__c = :controller.getId()                    
       and Status__c = 'Open']));                 
      deals.setPageSize(size);                 
       noOfRecords = deals.getResultSize();             
}             
return deals;         
}         
set;     
}     
public Boolean hasNext {         
get {             
return deals.getHasNext();         
}         
set;     
}     
public Boolean hasPrevious {         
get {             
return deals.getHasPrevious();        
 }         
set;     
}     
public Integer pageNumber {         
get {             
return deals.getPageNumber();        
 }         
set;     
}     
public void first() {
        deals.first();     
}     
public void last() {         
deals.last();     
}     
public void previous() {         
deals.previous();    
 }     
public void next() {         
deals.next();    
 }     
public PageReference refreshPageSize() {          
deals.setPageSize(size);          
return null;     
}     
public void showAll(){         
redirectUrl = '/apex/AcctDealRelatedList?id='+controller.getId()+'&fullscreen=true';     
}     
public void saveDeals(){         
try {             
deals.save();         

catch (Exception e) {             
ApexPages.addMessages(e);         
}     
}
}
We have created an Object called "Markets" following the standard MSA codes. Within each market, we have several accounts. I have had success mapping single accounts using a Visual Force page, but now I am looking to map multiple accounts within an MSA zone. Has anyone come up with a way to map multiple points in Visual Force? I am trying to avoid pay apps like Geopointe or MapAnything. Thanks.