• Bryan Jimenez
  • NEWBIE
  • 69 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 11
    Replies
Hi, Im working in visualforce right now, and I am adding a javascript code that should work like this.

http://jsfiddle.net/k5hkR/

However, it isnt working as I want it, any help on this?

Thank you,
 
<apex:page controller="ContactSearchController2" sidebar="false">

  <apex:form >
  <apex:pageMessages id="errors" />

  <apex:pageBlock title="Find Me A Customer!" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("firstName").value,
          document.getElementById("lastName").value,
          document.getElementById("accountName").value,
          document.getElementById("technology").value
          );
          var $rows = $("tr");

          $("doSearch();").keyup(function() {
    var val = $.trim(this.value);
    if (val === "")
        $rows.show();
    else {
        $rows.hide();
        $rows.has("td:contains(" + accountName + ")").show();
    }
});

      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="firstName" value="" />
          <apex:param name="lastName" value="" />
          <apex:param name="accountName" value="" />
          <apex:param name="technology" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">First Name<br/>
        <input type="text" id="firstName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Last Name<br/>
        <input type="text" id="lastName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Account<br/>
        <input type="text" id="accountName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Interested Technologies<br/>
          <select id="technology" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!technologies}" var="tech">
              <option value="{!tech}">{!tech}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!contacts}" var="contact">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="First Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="firstName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.firstName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Last Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="lastName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.lastName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="account.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.account.name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Technologies" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="interested_technologies__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.Interested_Technologies__c}"/>
            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
  </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>    

  </apex:pageBlock>

  </apex:form>

</apex:page>

 
Hi, I am struggling with a piece of javascript on my visualforce page. I want to be able to filter my results by typing into a search box and as I type the page rerenders to give me the results with the letters I have already typed into the search box. User-added image
As I type into the account box, I want all the accounts with the word I type in. For example, I have already typed in, "connect" I want all accounts with "connect" in the name to come up.

so far I have this in my visualforce page.
<apex:page controller="ContactSearchController2" sidebar="false">

  <apex:form >
  <apex:pageMessages id="errors" />

  <apex:pageBlock title="Find Me A Customer!" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("firstName").value,
          document.getElementById("lastName").value,
          document.getElementById("accountName").value,
          document.getElementById("technology").value
          );
          var $rows = $("tr");

          $("doSearch();").keyup(function() {
    var val = $.trim(this.value);
    if (val === "")
        $rows.show();
    else {
        $rows.hide();
        $rows.has("td:contains(" + accountName + ")").show();
    }
});

      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="firstName" value="" />
          <apex:param name="lastName" value="" />
          <apex:param name="accountName" value="" />
          <apex:param name="technology" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">First Name<br/>
        <input type="text" id="firstName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Last Name<br/>
        <input type="text" id="lastName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Account<br/>
        <input type="text" id="accountName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Interested Technologies<br/>
          <select id="technology" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!technologies}" var="tech">
              <option value="{!tech}">{!tech}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!contacts}" var="contact">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="First Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="firstName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.firstName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Last Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="lastName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.lastName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="account.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.account.name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Technologies" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="interested_technologies__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.Interested_Technologies__c}"/>
            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
  </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>    

  </apex:pageBlock>

  </apex:form>

</apex:page>

I want to integrate this into my code and I have tried but failed at it.

http://jsfiddle.net/k5hkR/


var $rows = $("tr");

$("#search").keyup(function() {
    var val = $.trim(this.value);
    if (val === "")
        $rows.show();
    else {
        $rows.hide();
        $rows.has("td:contains(" + val + ")").show();
    }
});


 
Hi,
I have created a simple Soql Query to Query a list of Properties 
public class PropertiesUptown {
Public List<McLabs2__Property__c> getPropertiesUptown() {
       List<McLabs2__Property__c> PropertiesUptown=[Select Name,Primary_Contact_Name__c,McLabs2__Loan_Balance__c,Loan_Origination_Date_v2__c,McLabs2__Loan_Maturity_Date__c
                                                                 From McLabs2__Property__c
                                                                 Where CustomField = Test
                                                                 And CustomField = Test2];
                                                                                          
        return PropertiesUptown;
}
}

That Query Works just fine when I use it. However, When trying to test it for deployment, I cant seem to get my test to work. 

This is my test class.
@isTest
public class PropertiesUptownTest 
{ 
    public static testMethod void TestSOQL() 
    {
        McLabs2__Property__c prop = new McLabs2__Property__c();
        // Add all required field
        prop.Activity_Notes__c='test';
        insert prop;


        PropertiesUptown testCont = new PropertiesUptown ();
        List<McLabs2__Property__c> lstProperty = testCont.getPropertiesUptown();
        
        System.assert( lstProperty != null);
        
    }
}

When I run this test, Code Coverage stays at none. Why would this be happening?

Any help is appreciated.

Thank you
Hi, 

I am trying to upload a test class into production but it has the following errors.

Convertlead.basicTestWithoutConvertedStatus Methods defined as TestMethod do not support Web Service Callouts null.
Convertlead.basicTestWith Methods defined as TestMethod do not support Web Service Callouts null
Convertlead.basicTestWithAccount Methods defined as TestMethod do not support Web Service Callouts null
Convertlead.basicTestWithAccounts Methods defined as TestMethod do not support Web Service Callouts null

 
@istest
public class convertleadtest {
        static testMethod void basicTestwith() {

        // Create dummy lead
        Lead testLead = new Lead(Company='Test Lead',FirstName='John',LastName='Doe');
        insert testLead;
    
        LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; 
        
        // Create dummy conversion
        ConvertLead aLeadPlugin = new ConvertLead();
        Map<String,Object> inputParams = new Map<String,Object>();
        Map<String,Object> outputParams = new Map<String,Object>();

        inputParams.put('LeadID',testLead.ID);
        inputParams.put('ConvertedStatus',convertStatus.MasterLabel);

        Process.PluginRequest request = new Process.PluginRequest(inputParams);
        Process.PluginResult result;
        result = aLeadPlugin.invoke(request);
        
        Lead aLead = [select name, id, isConverted from Lead where id = :testLead.ID];
        System.Assert(aLead.isConverted);
        
    }

/*
 * This is another basic test with just the LeadID and nothing else.
 */
 
    static testMethod void basicTestWithoutConvertedStatus() {

        // Create dummy lead
        Lead testLead = new Lead(Company='Test Lead',FirstName='John',LastName='Doe');
        insert testLead;
            
        // Create dummy conversion
        ConvertLead aLeadPlugin = new ConvertLead();
        Map<String,Object> inputParams = new Map<String,Object>();
        Map<String,Object> outputParams = new Map<String,Object>();

        inputParams.put('LeadID',testLead.ID);

        Process.PluginRequest request = new Process.PluginRequest(inputParams);
        Process.PluginResult result;
        result = aLeadPlugin.invoke(request);
        
        Lead aLead = [select name, id, isConverted from Lead where id = :testLead.ID];
        System.Assert(aLead.isConverted);
        
    }
    
 /*
  * This test is to test the convert Lead with the Account ID specified
  */
       static testMethod void basicTestwithAccount() {

        // Create dummy lead
        Lead testLead = new Lead(Company='Test Lead',FirstName='John',LastName='Doe');
        insert testLead;
        
        Account testAccount = new Account(name='Test Account');
        insert testAccount;
    

        LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; 
        
        // Create dummy conversion
        ConvertLead aLeadPlugin = new ConvertLead();
        Map<String,Object> inputParams = new Map<String,Object>();
        Map<String,Object> outputParams = new Map<String,Object>();

        inputParams.put('LeadID',testLead.ID);
        inputParams.put('AccountID',testAccount.ID);
        inputParams.put('ConvertedStatus',convertStatus.MasterLabel);

        Process.PluginRequest request = new Process.PluginRequest(inputParams);
        Process.PluginResult result;
        result = aLeadPlugin.invoke(request);
        
        Lead aLead = [select name, id, isConverted, convertedAccountID from Lead where id = :testLead.ID];
        System.Assert(aLead.isConverted);
        //System.debug('ACCOUNT AFTER' + aLead.convertedAccountID);
        System.AssertEquals(testAccount.ID, aLead.convertedAccountID);
    }

/*
  * This test is to test the convert Lead with the Company matching more than one existing Account Names
  */
       static testMethod void basicTestwithAccounts() {

        // Create dummy lead
        Lead testLead = new Lead(Company='Test Lead',FirstName='John',LastName='Doe');
        insert testLead;
        
        Account testAccount1 = new Account(name='Test Lead');
        insert testAccount1;
        Account testAccount2 = new Account(name='Test Lead');
        insert testAccount2;


        LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; 
        
        // Create dummy conversion
        ConvertLead aLeadPlugin = new ConvertLead();
        Map<String,Object> inputParams = new Map<String,Object>();
        Map<String,Object> outputParams = new Map<String,Object>();

        inputParams.put('LeadID',testLead.ID);
        inputParams.put('ConvertedStatus',convertStatus.MasterLabel);

        Process.PluginRequest request = new Process.PluginRequest(inputParams);
        Process.PluginResult result;
        result = aLeadPlugin.invoke(request);
        
        Lead aLead = [select name, id, isConverted, convertedAccountID from Lead where id = :testLead.ID];
        System.Assert(aLead.isConverted);
    }


 /*
  * -ve Test
  */    
    static testMethod void errorTest() {

        // Create dummy lead
        //Lead testLead = new Lead(Company='Test Lead',FirstName='John',LastName='Doe');
        LeadStatus convertStatus = [Select Id, MasterLabel from LeadStatus where IsConverted=true limit 1]; 
        
        // Create dummy conversion
        ConvertLead aLeadPlugin = new ConvertLead();
        Map<String,Object> inputParams = new Map<String,Object>();
        Map<String,Object> outputParams = new Map<String,Object>();
        inputParams.put('LeadID','00Q7XXXXxxxxxxx');
        inputParams.put('ConvertedStatus',convertStatus.MasterLabel);

        Process.PluginRequest request = new Process.PluginRequest(inputParams);
        Process.PluginResult result;
        try {
            result = aLeadPlugin.invoke(request);    
        }
        catch (Exception e) {
          System.debug('EXCEPTION' + e);
          System.AssertEquals(1,1);
        }
        
    }
    
    
 /*
  * This test is to test the describe() method
  */ 
        static testMethod void describeTest() {

                ConvertLead aLeadPlugin = new ConvertLead();
                Process.PluginDescribeResult result = aLeadPlugin.describe();
                
                System.AssertEquals(result.inputParameters.size(), 8);
                System.AssertEquals(result.OutputParameters.size(), 3);
        
        }

Where am I going wrong?
 
Hi, 
How can I remove the below "flow finished' notification from my visualforce page?
User-added image


I think this is preventing me from creating a component that I can use in an email template.
Thank you
Hi, 
I am new to apex and I am trying to query a dynamic field but I cannot get it to work.

I have a field named "relationship lead" on a custom object named "Prospects".

I want to be able to query the records based on the relationship lead. Is that possible?
 
public class ClientRelationshipController {
 Public List<Prospect__c> getProspects() {
        List<Prospect__c> Prospects=[Select Name,Property__c,Property_Name__c,Phone__c,Mobile__c,Prospect_Score__c,Email__c,Relationship_Lead__c
                                     From Prospect__c 
                                     Where Created_Date__c = Yesterday 
                                     And RecordType__c = 'Prospect'
                                     And Relationship_Lead__c = 'Dynamic Field'];
        return Prospects;
      }

 }


 
Hi,

I am new to apex and I need a little help with an error that will not go away.
 
public class ClientRelationshipController {
 Public List<Prospect__c> getProspects() {
        List<Prospect__c> Prospects=[Select Name,Property__c,Property_Name__c,Phone__c,Mobile__c,Prospect_Score__c,Email__c
                                     From Prospect__c 
                                     Where Created_Date__c = Today And Relationship_Lead__c != :Relationship_lead_ID__c
                                     And RecordType__c = 'Prospect'];
        return Prospects;
    }
}

Thank you,
Bryan
I am making a visual force page that can update itself daily to show the loan prospects for the previosu workday. Im thinking I would have to use rerender?

Also, how do I get this code to filter through my result and show only the prospects created yesterday?
 
<apex:page standardController="Prospect__c" recordSetVar="Prospects">
    <apex:pageBlock title="Loan Prospects List">
        
        <!-- Contacts List -->
        <apex:pageBlockTable value="{! Prospects }" var="Pro">
                    <apex:Column headerValue="Name">
                        <apex:outputLink value="/{!Pro.Id}">
                               <apex:outputText value="{!left(Pro.Name,50)}">                                                              
                               </apex:outputText>
                        </apex:outputLink>
                    </apex:Column> 
                    <apex:Column value="{! Pro.Property__c}"/>
                    <apex:Column value="{! Pro.Contact__c.Phone}"/>
                    <apex:Column value="{! Pro.Contact__C.MobilePhone}"/>
                    <apex:Column value="{! Pro.Prospect_Score__c}"/>
                    <apex:Column value="{! Pro.Email__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 
I am new to apex testing and I am stuck on writing a test class for my production org. I had to write a custom controller for a visualforce page I created and now I have to test this code in order to transfer it to my production org. I have no idea what to do in order to test a soql query despite trying the salesforce examples. Any help is greatly appreciated.
public class LoanProspectsController {
    Public List<Prospect__c> getProspects() {
        List<Prospect__c> Prospects=[Select Name,Email__c
                                     From Prospect__c
                                     Where Loan_Amount__c = 9];
        return Prospects;
    }
}
This is my custom controller which I used to query loan prospects with a loan amount of 9.

How am i able to test this?

 
Hi, I am struggling with a piece of javascript on my visualforce page. I want to be able to filter my results by typing into a search box and as I type the page rerenders to give me the results with the letters I have already typed into the search box. User-added image
As I type into the account box, I want all the accounts with the word I type in. For example, I have already typed in, "connect" I want all accounts with "connect" in the name to come up.

so far I have this in my visualforce page.
<apex:page controller="ContactSearchController2" sidebar="false">

  <apex:form >
  <apex:pageMessages id="errors" />

  <apex:pageBlock title="Find Me A Customer!" mode="edit">

  <table width="100%" border="0">
  <tr>  
    <td width="200" valign="top">

      <apex:pageBlock title="Parameters" mode="edit" id="criteria">

      <script type="text/javascript">
      function doSearch() {
        searchServer(
          document.getElementById("firstName").value,
          document.getElementById("lastName").value,
          document.getElementById("accountName").value,
          document.getElementById("technology").value
          );
          var $rows = $("tr");

          $("doSearch();").keyup(function() {
    var val = $.trim(this.value);
    if (val === "")
        $rows.show();
    else {
        $rows.hide();
        $rows.has("td:contains(" + accountName + ")").show();
    }
});

      }
      </script> 

      <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors">
          <apex:param name="firstName" value="" />
          <apex:param name="lastName" value="" />
          <apex:param name="accountName" value="" />
          <apex:param name="technology" value="" />
      </apex:actionFunction>

      <table cellpadding="2" cellspacing="2">
      <tr>
        <td style="font-weight:bold;">First Name<br/>
        <input type="text" id="firstName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Last Name<br/>
        <input type="text" id="lastName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Account<br/>
        <input type="text" id="accountName" onkeyup="doSearch();"/>
        </td>
      </tr>
      <tr>
        <td style="font-weight:bold;">Interested Technologies<br/>
          <select id="technology" onchange="doSearch();">
            <option value=""></option>
            <apex:repeat value="{!technologies}" var="tech">
              <option value="{!tech}">{!tech}</option>
            </apex:repeat>
          </select>
        </td>
      </tr>
      </table>

      </apex:pageBlock>

    </td>
    <td valign="top">

    <apex:pageBlock mode="edit" id="results">

        <apex:pageBlockTable value="{!contacts}" var="contact">

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="First Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="firstName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.firstName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Last Name" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="lastName" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.lastName}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Account" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="account.name" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.account.name}"/>
            </apex:column>

            <apex:column >
                <apex:facet name="header">
                    <apex:commandLink value="Technologies" action="{!toggleSort}" rerender="results,debug">
                        <apex:param name="sortField" value="interested_technologies__c" assignTo="{!sortField}"/>
                    </apex:commandLink>
                </apex:facet>
                <apex:outputField value="{!contact.Interested_Technologies__c}"/>
            </apex:column>

        </apex:pageBlockTable>

    </apex:pageBlock>

    </td>
  </tr>
  </table>

  <apex:pageBlock title="Debug - SOQL" id="debug">
      <apex:outputText value="{!debugSoql}" />           
  </apex:pageBlock>    

  </apex:pageBlock>

  </apex:form>

</apex:page>

I want to integrate this into my code and I have tried but failed at it.

http://jsfiddle.net/k5hkR/


var $rows = $("tr");

$("#search").keyup(function() {
    var val = $.trim(this.value);
    if (val === "")
        $rows.show();
    else {
        $rows.hide();
        $rows.has("td:contains(" + val + ")").show();
    }
});


 
Hi,
I have created a simple Soql Query to Query a list of Properties 
public class PropertiesUptown {
Public List<McLabs2__Property__c> getPropertiesUptown() {
       List<McLabs2__Property__c> PropertiesUptown=[Select Name,Primary_Contact_Name__c,McLabs2__Loan_Balance__c,Loan_Origination_Date_v2__c,McLabs2__Loan_Maturity_Date__c
                                                                 From McLabs2__Property__c
                                                                 Where CustomField = Test
                                                                 And CustomField = Test2];
                                                                                          
        return PropertiesUptown;
}
}

That Query Works just fine when I use it. However, When trying to test it for deployment, I cant seem to get my test to work. 

This is my test class.
@isTest
public class PropertiesUptownTest 
{ 
    public static testMethod void TestSOQL() 
    {
        McLabs2__Property__c prop = new McLabs2__Property__c();
        // Add all required field
        prop.Activity_Notes__c='test';
        insert prop;


        PropertiesUptown testCont = new PropertiesUptown ();
        List<McLabs2__Property__c> lstProperty = testCont.getPropertiesUptown();
        
        System.assert( lstProperty != null);
        
    }
}

When I run this test, Code Coverage stays at none. Why would this be happening?

Any help is appreciated.

Thank you
Hi, 
I am new to apex and I am trying to query a dynamic field but I cannot get it to work.

I have a field named "relationship lead" on a custom object named "Prospects".

I want to be able to query the records based on the relationship lead. Is that possible?
 
public class ClientRelationshipController {
 Public List<Prospect__c> getProspects() {
        List<Prospect__c> Prospects=[Select Name,Property__c,Property_Name__c,Phone__c,Mobile__c,Prospect_Score__c,Email__c,Relationship_Lead__c
                                     From Prospect__c 
                                     Where Created_Date__c = Yesterday 
                                     And RecordType__c = 'Prospect'
                                     And Relationship_Lead__c = 'Dynamic Field'];
        return Prospects;
      }

 }


 
I am making a visual force page that can update itself daily to show the loan prospects for the previosu workday. Im thinking I would have to use rerender?

Also, how do I get this code to filter through my result and show only the prospects created yesterday?
 
<apex:page standardController="Prospect__c" recordSetVar="Prospects">
    <apex:pageBlock title="Loan Prospects List">
        
        <!-- Contacts List -->
        <apex:pageBlockTable value="{! Prospects }" var="Pro">
                    <apex:Column headerValue="Name">
                        <apex:outputLink value="/{!Pro.Id}">
                               <apex:outputText value="{!left(Pro.Name,50)}">                                                              
                               </apex:outputText>
                        </apex:outputLink>
                    </apex:Column> 
                    <apex:Column value="{! Pro.Property__c}"/>
                    <apex:Column value="{! Pro.Contact__c.Phone}"/>
                    <apex:Column value="{! Pro.Contact__C.MobilePhone}"/>
                    <apex:Column value="{! Pro.Prospect_Score__c}"/>
                    <apex:Column value="{! Pro.Email__c}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

 
I am new to apex testing and I am stuck on writing a test class for my production org. I had to write a custom controller for a visualforce page I created and now I have to test this code in order to transfer it to my production org. I have no idea what to do in order to test a soql query despite trying the salesforce examples. Any help is greatly appreciated.
public class LoanProspectsController {
    Public List<Prospect__c> getProspects() {
        List<Prospect__c> Prospects=[Select Name,Email__c
                                     From Prospect__c
                                     Where Loan_Amount__c = 9];
        return Prospects;
    }
}
This is my custom controller which I used to query loan prospects with a loan amount of 9.

How am i able to test this?