• Admin User 10568
  • NEWBIE
  • 45 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 13
    Replies

Hello, 

Wondering if anyone knows how to parse an object Id to a Visual Force page when its embeded in a Salesforce Site and is public. 

My use case is a URL is created on the Object that our sales people can share with anyone outside the organisation. I've created the page and class and added it to a site and made it public. Only it wont parse the Id from the site to the page. 

Any help would be awesome. 

Hi, 

I would like to write a test to understand if a next business date/time trigger is updating a field. I'm trying to test by inserting a new lead and then compare its next task start time (next business date/time) is the same as the systems next business date/time. At the minute the console is returning:"Comparison arguments must be compatible types: Datetime, REPRO__Lead__c". Wondering if anyone has a resource or an idea on how can get this working?
@isTest
public class NextAvailableBusinessMomentTest{
    @isTest
    private static void newLeadTaskStartTimeTest(){
        
        REPRO__Lead__c ld = new REPRO__Lead__c();
        ld.REPRO__First_Name__c = 'Homer';
        ld.REPRO__Last_Name__c = 'Simpson';
        ld.REPRO__Email__c = 'hsimpson@springfieldmail.com';
        ld.Name = 'Homer Simpson - Time Check';
        
        Test.startTest();
       
         //Insert the above RP custom lead field values
         insert ld;
		
        //Get the default business hours
        Id businessHourId = [SELECT Id FROM BusinessHours WHERE IsDefault = true].Id;
        
        //Get the next date when business hours are open. If the specified target date falls within business hours, this target date is returned.
        Datetime targetDate = system.today();
        Datetime nextDate = BusinessHours.nextStartDate(businessHourId, targetDate);
		
        //Get Task Start Time created by Next Available Business Moment triggered before inserted lead created
        REPRO__Lead__c updatelead = [Select Task_Start_Time__c FROM REPRO__Lead__c where Id =: ld.Id];
        
        //expected vs actual system response for next task completed task time
        System.assertEquals(nextDate, updatelead);

        Test.stopTest();
            
    }
    
    
}
Hi, I would like to create a trigger that prints the next business date/time available to a custom field on a custom object. I would like the trigger to run after each new instance of the object type. I'm getting an error "a value cannot be stored to Task_Start_Time__c in type Repro_Lead__c". It's a datetime field and I was wondering how I could get this to work?
 
trigger NextAvailableBusinessMoment on REPRO__Lead__c (after insert) {

    
// Get the default business hours

BusinessHours bh = [SELECT Id FROM BusinessHours WHERE IsDefault=true];

// Starting from the System.now, find the next date when business hours reopens.
//  This returned next day start time will be in the local time zone

Datetime nextStart = BusinessHours.nextStartDate(bh.id,  System.now());

// print nextStart date/time in custom field on trigger object

REPRO__Lead__c.Task_Start_Time__c = nextStart;
    

}

 
Hi, 

This table uses a map to group data to render with rowspan.

Works a treat.

Where it gets tricky is rendering a bottom-border across the table with rowspan.

This is how it renders currently. The thick bottom-border needs to span the last of type for the group.

Example of how the page is rendering
<apex:page standardController="REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false"  >
 
    <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
    <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
    
        <table border="4px solid black;" align="center" cellpadding="5" style="border-collapse: collapse; font-family: sans-serif; text-align: center; cell-color:white;" >
        
            <tr style= "font-family: sans-serif; font-weight: bold; text-align: center;" >
    <th style="border: 2px solid black;">Level</th>    
    <th style="border: 2px solid black;">Property</th>
    <th style="border: 2px solid black;">Type</th>
    <th style="border: 2px solid black;">Bdr</th>
    <th style="border: 2px solid black;">Bath</th>
    <th style="border: 2px solid black;">Study</th>
    <th style="border: 2px solid black;">Internal Size m² </th>
    <th style="border: 2px solid black;">External Size m² </th>
    <th style="border: 2px solid black;">Car </th>
    <th style="border: 2px solid black;">Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att"> 
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}"><td rowspan="{!(modulecountMap[key])}" style="border: 2px solid black;"  >
                            <apex:outputText value="{!att.Level}" /></td>
                    </apex:outputPanel>
           
            <td style="border: 2px solid black;"><apex:outputText value="{!att.PropertyPriceListName}" style="{!IF ((att.Status !='Available'),"color: #A9A9A9;","")}" /></td>
            
            <td style="border: 2px solid black;"><apex:outputText value="{!att.RType}" style="{!IF ((att.Status !='Available'),"color: #A9A9A9;","")}" /></td>
                     
            <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                       
                             <apex:outputText value="{!att.Bdr}" rendered="{!att.Status = 'Available'}" />
                    </apex:outputPanel></td>
             
           <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Bth}" rendered="{att.Status ='Available'}" />
                <apex:outputText value="{!att.Bth}" rendered="{!att.Status = 'Available'}" />
                             </apex:outputPanel></td>
            
                    <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Study}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Study}" rendered="{!att.Status = 'Available'}" />
                             </apex:outputPanel></td>
            
           <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Internal}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Internal}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
            
             <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.External}" rendered="{att.Status ='Available'}"  />
                            <apex:outputText value="{!att.External}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
         
            <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Car}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Car}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
            
               <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                    <apex:outputLabel value="{!att.Price}" rendered="{att.Status ='Available'}"  />
                <apex:outputText rendered="{!att.Status = 'Available'}" value="${0,number,#,###,###.00}" >
                <apex:param value="{!att.Price}"/></apex:outputText>
                            <apex:outputLabel value="Reserved" rendered="{!att.Status != 'Available'}"/>
                </apex:outputPanel></td>
     
                    <apex:variable var="count" value="{!count+1}"/>
                 </tr>
            </apex:repeat>
                  </apex:repeat>
    </table>
      
    <br></br>
   
        <div style="font-family: sans-serif; text-align:center;">
            <apex:image value="{!$Resource.CgLogo}" width="50%" />
                </div>   
   
   
    <p  style= "font-family: sans-serif; text-align: center;" >Level 2, 102-108 Toorak Road, South Yarra <br/>
        Telephone 03 9827 1177<br/>
        www.castrangilbert.com.au
    </p>

</apex:page>

 
Hi, 

Getting the following error: 

The element type "apex:outputPanel" must be terminated by the matching end-tag "</apex:outputPanel>".

For the following apex page: 

<apex:page standardController="REPRO__Project__c" extensions="ProjectAvailableONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
        <apex:pageBlockTable value="{!oncs}" var="onc" align="center" cellpadding="2" border="1"  style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;" >
              <apex:column headerValue="Level" value="{!onc.Property_Level__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                  <apex:column value="{!onc.Price_List_Property_Name__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /> 
                    <apex:column value="{!onc.REPRO__Type__c}" headerValue="Type" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                     
             <apex:column headerValue="Bdr" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bdr__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bdr__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
             
            <apex:column headerValue="Bath" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bth__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bth__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Study" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Study__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Study__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Internal Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Internal_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Internal_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="External Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__External_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__External_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
         
            <apex:column headerValue="Car" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Car__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Car__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
                <apex:column headerValue="List Price" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                    <apex:outputLabel value="{!onc.REPRO__List_Price__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                        <apex:outputField value="{!onc.REPRO__List_Price__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                            <apex:outputLabel value="Reserved" rendered="{!onc.REPRO__Status__c != 'Available'}"  />
                                </apex:column> 
            
        </apex:pageBlockTable>

    </apex:pageBlock> 
</apex:page>

// The intent is to make conditional formating within the apex table.

Any help would be awesome. 
Hi, 

Exclude fields values based on picklist value SOQL. 

I have a picklist for status. Anything without a status of 'available' I would like to exclude certain fields (not all). 

Any help would be very welcomed and appreciated. 

I'm working from here:

SELECT Id,name,Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c, REPRO__Status__c from REPRO__Property__c WHERE REPRO__Status__c= ('Available')  EXCLUDES ('REPRO__Status__c')

Many thanks, 
Alex
Hi, 

Hopeing someone can help me here. 

I would like to filter results in a pageBlockTable in ascending order.

I've created a standard controller extension: 

public with sharing class ProjectONSExtension
{
    private final Id acctId;
    public List<REPRO__Project__c> oncs { get; set; }

    public ProjectONSExtension(ApexPages.StandardController stdController)
    {
        acctId = stdController.getId();
        oncs = Database.query('SELECT Name,REPRO__Street__c, REPRO__City__c, (SELECT Id,name,Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c,REPRO__Status__c from REPRO__Properties__r where REPRO__Project__c =:acctId order by Price_List_Property_Name__c )' +
                ' FROM REPRO__Project__c ' 
   );             
    }
}

It runs without an error. But it didn't order the pageBlockTable results in ascending order. Boo! Any thoughts?

Here is the visual page for reference:

<apex:page standardController="REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
   
        <apex:pageBlockTable value="{!REPRO__Project__c.REPRO__Properties__r}" var="custom" align="center" cellpadding="1" border="2"  style="font-weight: bold; text-align: center; ">
              <apex:column value="{!custom.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
              <apex:column value="{!custom.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
              <apex:column value="{!custom.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
            </apex:pageBlockTable>

Any help would be greatly appreciated :)
Hi, 

I would like to Access Records with object IDs within a visualpage with a custom controller. The use case is: User hits button, renders the visualforce page and it renders data relating to the object they're on. 

The current code doesn't require an object ID to render. It renders everything. 

See page below:

<apex:page Controller="PriceListAscending" renderAs="pdf" showHeader="false" >

    <apex:pageBlock >
     
          <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" style="font-weight: bold">
               <apex:column value="{!e.name} {!e.REPRO__Street__c} {!e.REPRO__City__c}" style= "text-align: center;"/>
         </apex:pageBlockTable>
             <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" style="font-weight: bold">
        <apex:column value="{! TODAY()}" style= "text-align: center;" />
              </apex:pageBlockTable>
   
    <apex:pageBlockTable value="{!Events}" var="e">
<apex:column >
        <apex:pageBlockTable value="{!e.REPRO__Properties__r}" var="custom" align="center" cellpadding="2" border="2"  style="font-weight: bold; text-align: center; ">
              <apex:column value="{!custom.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
              <apex:column value="{!custom.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
              <apex:column value="{!custom.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
            </apex:pageBlockTable>
    </apex:column>
        </apex:pageBlockTable>
           
Any help would be great. The trailhead examples do this with the standard controller.
 
Hi, 

Hoping someone can help me here. 

I've written the following custom apex class: 

public class PriceListAscending{
public String sortOrder = 'Name';
public list<REPRO__Project__c> getEvents() {
    list<REPRO__Project__c> results = Database.query(
        ' SELECT Name, REPRO__Street__c, REPRO__City__c,(SELECT Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c,REPRO__Status__c from REPRO__Properties__r) ' +
        ' FROM REPRO__Project__c '  + 
        ' ORDER BY ' + sortOrder + ' ASC '
    );
    return results;
}
}

It runs without an error. I tested the query. It returns the requested data. The subquery is returned as one column. It would be nice if it was a column for each field requested. 

My aim is to use the data from the query to populate an apex block table for a Visualforce page. Could someone let me know where I'm going wrong calling the fields and sub query fields?

Here is my page: 

<apex:page Controller="PriceListAscending" renderAs="pdf" showHeader="false" >

    <apex:pageBlock>
        
        <h1 style= "text-align: center;">{!Events.Name}</h1>
        <p style= "text-align: center;">{!Events.REPRO__Street__c} {!Events.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
        
    <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" border="4"  style=" font-weight: bold; text-align: center; " >
      <apex:column value="{!e.REPRO__Properties__r.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
   </apex:pageBlockTable>   
    </apex:pageBlock> 
  </apex:page>

Here is the current error: Unknown property 'VisualforceArrayList.Name'

Any help would be greatly appreciated.

 
Hi, 

Hoping someone could help me out.

I have the following apex class: 

public class PriceListAscending{
private String sortOrder = 'REPRO__Project_Name__c';
public list<REPRO__Project__c> getEvents() {
    list<REPRO__Project__c> results = Database.query(
        ' SELECT REPRO__Project_Name__c, REPRO__Properties__r.REPRO__Property__c, REPRO__Properties__r.REPRO__City__c, REPRO__Properties__r.Property_Level__c, REPRO__Properties__r.Price_List_Property_Name__c, REPRO__Properties__r.REPRO__Type__c,REPRO__Properties__r.REPRO__Bdr__c,REPRO__Properties__r.REPRO__Bth__c,REPRO__Properties__r.REPRO__Study__c,REPRO__Properties__r.REPRO__Internal_Size__c,REPRO__Properties__r.REPRO__External_Size__c, REPRO__Properties_r.REPRO__Car_c, REPRO__Properties__r.REPRO__List_Price__c, REPRO__Properties__r.REPRO__Status_c ' + 
        ' FROM REPRO__Project__c'  + 
        ' ORDER BY ' + sortOrder + ' ASC '
    );
    return results;
}
}

There is no error displayed in the editor. 

When I try to call the fields from a pageblocktable for my visual page, I get the following error: Invalid field Property_Level__c for SObject REPRO__Project__c

Here is an example of the call: 

<apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" border="4"  style=" font-weight: bold; text-align: center" >
  <apex:column value="{!e.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />

Any help would be greatly appreciated.
 
Hi, 

I would like to write a test to understand if a next business date/time trigger is updating a field. I'm trying to test by inserting a new lead and then compare its next task start time (next business date/time) is the same as the systems next business date/time. At the minute the console is returning:"Comparison arguments must be compatible types: Datetime, REPRO__Lead__c". Wondering if anyone has a resource or an idea on how can get this working?
@isTest
public class NextAvailableBusinessMomentTest{
    @isTest
    private static void newLeadTaskStartTimeTest(){
        
        REPRO__Lead__c ld = new REPRO__Lead__c();
        ld.REPRO__First_Name__c = 'Homer';
        ld.REPRO__Last_Name__c = 'Simpson';
        ld.REPRO__Email__c = 'hsimpson@springfieldmail.com';
        ld.Name = 'Homer Simpson - Time Check';
        
        Test.startTest();
       
         //Insert the above RP custom lead field values
         insert ld;
		
        //Get the default business hours
        Id businessHourId = [SELECT Id FROM BusinessHours WHERE IsDefault = true].Id;
        
        //Get the next date when business hours are open. If the specified target date falls within business hours, this target date is returned.
        Datetime targetDate = system.today();
        Datetime nextDate = BusinessHours.nextStartDate(businessHourId, targetDate);
		
        //Get Task Start Time created by Next Available Business Moment triggered before inserted lead created
        REPRO__Lead__c updatelead = [Select Task_Start_Time__c FROM REPRO__Lead__c where Id =: ld.Id];
        
        //expected vs actual system response for next task completed task time
        System.assertEquals(nextDate, updatelead);

        Test.stopTest();
            
    }
    
    
}
Hi, I would like to create a trigger that prints the next business date/time available to a custom field on a custom object. I would like the trigger to run after each new instance of the object type. I'm getting an error "a value cannot be stored to Task_Start_Time__c in type Repro_Lead__c". It's a datetime field and I was wondering how I could get this to work?
 
trigger NextAvailableBusinessMoment on REPRO__Lead__c (after insert) {

    
// Get the default business hours

BusinessHours bh = [SELECT Id FROM BusinessHours WHERE IsDefault=true];

// Starting from the System.now, find the next date when business hours reopens.
//  This returned next day start time will be in the local time zone

Datetime nextStart = BusinessHours.nextStartDate(bh.id,  System.now());

// print nextStart date/time in custom field on trigger object

REPRO__Lead__c.Task_Start_Time__c = nextStart;
    

}

 
Hi, 

This table uses a map to group data to render with rowspan.

Works a treat.

Where it gets tricky is rendering a bottom-border across the table with rowspan.

This is how it renders currently. The thick bottom-border needs to span the last of type for the group.

Example of how the page is rendering
<apex:page standardController="REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false"  >
 
    <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
    <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
    
        <table border="4px solid black;" align="center" cellpadding="5" style="border-collapse: collapse; font-family: sans-serif; text-align: center; cell-color:white;" >
        
            <tr style= "font-family: sans-serif; font-weight: bold; text-align: center;" >
    <th style="border: 2px solid black;">Level</th>    
    <th style="border: 2px solid black;">Property</th>
    <th style="border: 2px solid black;">Type</th>
    <th style="border: 2px solid black;">Bdr</th>
    <th style="border: 2px solid black;">Bath</th>
    <th style="border: 2px solid black;">Study</th>
    <th style="border: 2px solid black;">Internal Size m² </th>
    <th style="border: 2px solid black;">External Size m² </th>
    <th style="border: 2px solid black;">Car </th>
    <th style="border: 2px solid black;">Price </th>
    </tr>    
     <apex:repeat id="myRepeatHeader" value="{!LevelList}" var="key">         
         <apex:variable var="count" value="{!1}"/>            
            <apex:repeat id="contactDetails" value="{!oncs[key]}" var="att"> 
                <tr>
                  <apex:outputPanel layout="none" rendered="{!count==1}"><td rowspan="{!(modulecountMap[key])}" style="border: 2px solid black;"  >
                            <apex:outputText value="{!att.Level}" /></td>
                    </apex:outputPanel>
           
            <td style="border: 2px solid black;"><apex:outputText value="{!att.PropertyPriceListName}" style="{!IF ((att.Status !='Available'),"color: #A9A9A9;","")}" /></td>
            
            <td style="border: 2px solid black;"><apex:outputText value="{!att.RType}" style="{!IF ((att.Status !='Available'),"color: #A9A9A9;","")}" /></td>
                     
            <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                       
                             <apex:outputText value="{!att.Bdr}" rendered="{!att.Status = 'Available'}" />
                    </apex:outputPanel></td>
             
           <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Bth}" rendered="{att.Status ='Available'}" />
                <apex:outputText value="{!att.Bth}" rendered="{!att.Status = 'Available'}" />
                             </apex:outputPanel></td>
            
                    <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Study}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Study}" rendered="{!att.Status = 'Available'}" />
                             </apex:outputPanel></td>
            
           <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Internal}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Internal}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
            
             <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.External}" rendered="{att.Status ='Available'}"  />
                            <apex:outputText value="{!att.External}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
         
            <td style="border: 2px solid black;"><apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                           <apex:outputLabel value="{!att.Car}" rendered="{att.Status ='Available'}"  />
                             <apex:outputText value="{!att.Car}" rendered="{!att.Status = 'Available'}"  />
                             </apex:outputPanel></td>
            
               <td style="border: 2px solid black;"> <apex:outputPanel style="{!IF ((att.Status !='Available'),'color: #A9A9A9;','')}" >
                    <apex:outputLabel value="{!att.Price}" rendered="{att.Status ='Available'}"  />
                <apex:outputText rendered="{!att.Status = 'Available'}" value="${0,number,#,###,###.00}" >
                <apex:param value="{!att.Price}"/></apex:outputText>
                            <apex:outputLabel value="Reserved" rendered="{!att.Status != 'Available'}"/>
                </apex:outputPanel></td>
     
                    <apex:variable var="count" value="{!count+1}"/>
                 </tr>
            </apex:repeat>
                  </apex:repeat>
    </table>
      
    <br></br>
   
        <div style="font-family: sans-serif; text-align:center;">
            <apex:image value="{!$Resource.CgLogo}" width="50%" />
                </div>   
   
   
    <p  style= "font-family: sans-serif; text-align: center;" >Level 2, 102-108 Toorak Road, South Yarra <br/>
        Telephone 03 9827 1177<br/>
        www.castrangilbert.com.au
    </p>

</apex:page>

 
Hi, 

Getting the following error: 

The element type "apex:outputPanel" must be terminated by the matching end-tag "</apex:outputPanel>".

For the following apex page: 

<apex:page standardController="REPRO__Project__c" extensions="ProjectAvailableONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "font-family: sans-serif; font-weight: bold; text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "font-family: sans-serif; text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
  
        <apex:pageBlockTable value="{!oncs}" var="onc" align="center" cellpadding="2" border="1"  style="font-family: sans-serif; font-weight: bold; text-align: center; background-color:white;" >
              <apex:column headerValue="Level" value="{!onc.Property_Level__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                  <apex:column value="{!onc.Price_List_Property_Name__c}" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" /> 
                    <apex:column value="{!onc.REPRO__Type__c}" headerValue="Type" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" />
                     
             <apex:column headerValue="Bdr" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bdr__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bdr__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
             
            <apex:column headerValue="Bath" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Bth__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Bth__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Study" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Study__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Study__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="Internal Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Internal_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Internal_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
            <apex:column headerValue="External Area m²" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__External_Size__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__External_Size__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
         
            <apex:column headerValue="Car" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                           <apex:outputLabel value="{!onc.REPRO__Car__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                            <apex:outputField value="{!onc.REPRO__Car__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                             </apex:column>
            
                <apex:column headerValue="List Price" style="{!IF ((onc.REPRO__Status__c !='Available'),"background-color: #A9A9A9;","")}" >
                    <apex:outputLabel value="{!onc.REPRO__List_Price__c}" rendered="{onc.REPRO__Status__c ='Available'}"  />
                        <apex:outputField value="{!onc.REPRO__List_Price__c}" rendered="{!onc.REPRO__Status__c = 'Available'}"  />
                            <apex:outputLabel value="Reserved" rendered="{!onc.REPRO__Status__c != 'Available'}"  />
                                </apex:column> 
            
        </apex:pageBlockTable>

    </apex:pageBlock> 
</apex:page>

// The intent is to make conditional formating within the apex table.

Any help would be awesome. 
Hi, 

Exclude fields values based on picklist value SOQL. 

I have a picklist for status. Anything without a status of 'available' I would like to exclude certain fields (not all). 

Any help would be very welcomed and appreciated. 

I'm working from here:

SELECT Id,name,Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c, REPRO__Status__c from REPRO__Property__c WHERE REPRO__Status__c= ('Available')  EXCLUDES ('REPRO__Status__c')

Many thanks, 
Alex
Hi, 

Hopeing someone can help me here. 

I would like to filter results in a pageBlockTable in ascending order.

I've created a standard controller extension: 

public with sharing class ProjectONSExtension
{
    private final Id acctId;
    public List<REPRO__Project__c> oncs { get; set; }

    public ProjectONSExtension(ApexPages.StandardController stdController)
    {
        acctId = stdController.getId();
        oncs = Database.query('SELECT Name,REPRO__Street__c, REPRO__City__c, (SELECT Id,name,Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c,REPRO__Status__c from REPRO__Properties__r where REPRO__Project__c =:acctId order by Price_List_Property_Name__c )' +
                ' FROM REPRO__Project__c ' 
   );             
    }
}

It runs without an error. But it didn't order the pageBlockTable results in ascending order. Boo! Any thoughts?

Here is the visual page for reference:

<apex:page standardController="REPRO__Project__c" extensions="ProjectONSExtension" renderAs="pdf" showHeader="false" sidebar="false" >

    <apex:pageBlock >
     
          <h1 style= "text-align: center;">{!REPRO__Project__c.name}</h1>
        <p style= "text-align: center;">{!REPRO__Project__c.REPRO__Street__c}, {!REPRO__Project__c.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
   
        <apex:pageBlockTable value="{!REPRO__Project__c.REPRO__Properties__r}" var="custom" align="center" cellpadding="1" border="2"  style="font-weight: bold; text-align: center; ">
              <apex:column value="{!custom.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
              <apex:column value="{!custom.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
              <apex:column value="{!custom.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
            </apex:pageBlockTable>

Any help would be greatly appreciated :)
Hi, 

I would like to Access Records with object IDs within a visualpage with a custom controller. The use case is: User hits button, renders the visualforce page and it renders data relating to the object they're on. 

The current code doesn't require an object ID to render. It renders everything. 

See page below:

<apex:page Controller="PriceListAscending" renderAs="pdf" showHeader="false" >

    <apex:pageBlock >
     
          <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" style="font-weight: bold">
               <apex:column value="{!e.name} {!e.REPRO__Street__c} {!e.REPRO__City__c}" style= "text-align: center;"/>
         </apex:pageBlockTable>
             <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" style="font-weight: bold">
        <apex:column value="{! TODAY()}" style= "text-align: center;" />
              </apex:pageBlockTable>
   
    <apex:pageBlockTable value="{!Events}" var="e">
<apex:column >
        <apex:pageBlockTable value="{!e.REPRO__Properties__r}" var="custom" align="center" cellpadding="2" border="2"  style="font-weight: bold; text-align: center; ">
              <apex:column value="{!custom.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
              <apex:column value="{!custom.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
              <apex:column value="{!custom.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
              <apex:column value="{!custom.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
            </apex:pageBlockTable>
    </apex:column>
        </apex:pageBlockTable>
           
Any help would be great. The trailhead examples do this with the standard controller.
 
Hi, 

Hoping someone can help me here. 

I've written the following custom apex class: 

public class PriceListAscending{
public String sortOrder = 'Name';
public list<REPRO__Project__c> getEvents() {
    list<REPRO__Project__c> results = Database.query(
        ' SELECT Name, REPRO__Street__c, REPRO__City__c,(SELECT Property_Level__c,Price_List_Property_Name__c,REPRO__Type__c,REPRO__Bdr__c,REPRO__Bth__c,REPRO__Study__c,REPRO__Internal_Size__c,REPRO__External_Size__c,REPRO__Car__c,REPRO__List_Price__c,REPRO__Status__c from REPRO__Properties__r) ' +
        ' FROM REPRO__Project__c '  + 
        ' ORDER BY ' + sortOrder + ' ASC '
    );
    return results;
}
}

It runs without an error. I tested the query. It returns the requested data. The subquery is returned as one column. It would be nice if it was a column for each field requested. 

My aim is to use the data from the query to populate an apex block table for a Visualforce page. Could someone let me know where I'm going wrong calling the fields and sub query fields?

Here is my page: 

<apex:page Controller="PriceListAscending" renderAs="pdf" showHeader="false" >

    <apex:pageBlock>
        
        <h1 style= "text-align: center;">{!Events.Name}</h1>
        <p style= "text-align: center;">{!Events.REPRO__Street__c} {!Events.REPRO__City__c} <br/> Price List as of {! TODAY()} </p>
        
    <apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" border="4"  style=" font-weight: bold; text-align: center; " >
      <apex:column value="{!e.REPRO__Properties__r.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.Price_List_Property_Name__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Type__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />   
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Bdr__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Bth__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Study__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Internal_Size__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; "  />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__External_Size__c}"  style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Car__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__List_Price__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
      <apex:column value="{!e.REPRO__Properties__r.REPRO__Status__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />
   </apex:pageBlockTable>   
    </apex:pageBlock> 
  </apex:page>

Here is the current error: Unknown property 'VisualforceArrayList.Name'

Any help would be greatly appreciated.

 
Hi, 

Hoping someone could help me out.

I have the following apex class: 

public class PriceListAscending{
private String sortOrder = 'REPRO__Project_Name__c';
public list<REPRO__Project__c> getEvents() {
    list<REPRO__Project__c> results = Database.query(
        ' SELECT REPRO__Project_Name__c, REPRO__Properties__r.REPRO__Property__c, REPRO__Properties__r.REPRO__City__c, REPRO__Properties__r.Property_Level__c, REPRO__Properties__r.Price_List_Property_Name__c, REPRO__Properties__r.REPRO__Type__c,REPRO__Properties__r.REPRO__Bdr__c,REPRO__Properties__r.REPRO__Bth__c,REPRO__Properties__r.REPRO__Study__c,REPRO__Properties__r.REPRO__Internal_Size__c,REPRO__Properties__r.REPRO__External_Size__c, REPRO__Properties_r.REPRO__Car_c, REPRO__Properties__r.REPRO__List_Price__c, REPRO__Properties__r.REPRO__Status_c ' + 
        ' FROM REPRO__Project__c'  + 
        ' ORDER BY ' + sortOrder + ' ASC '
    );
    return results;
}
}

There is no error displayed in the editor. 

When I try to call the fields from a pageblocktable for my visual page, I get the following error: Invalid field Property_Level__c for SObject REPRO__Project__c

Here is an example of the call: 

<apex:pageBlockTable value="{!Events}" var="e" align="center" cellpadding="2" border="4"  style=" font-weight: bold; text-align: center" >
  <apex:column value="{!e.Property_Level__c}" style="padding: 10px;order-bottom: 1px solid #ddd;border: 1px solid black; text-align: center; " />

Any help would be greatly appreciated.
 
Hi,

I need to render the background color of a cell based on the value in the cell. The value is retrieved from the a map generated by the controller. The background color will be one of seven colors based on the value retrieved. I have a method written that sets the value of the color as a string and takes the value of the rendered double as an arguement.

It's returning an error "Unknown property 'heatMapController.color'. I figured out from other posts in the forum about this error  that the system is looking at the statement:

style="{!color(defendNTAPNum[o.id])}"

as a function instead of a method call, but how do I call the method and pass the value in?  The method signature is:  String getColor(Double Val)

Here is the method:
public string getColor(Double val){
        color = '';
        if(val >= 0 && val < 25){
            color='background-color:#FF0000;';
        }
        if(val >= 25 && val < 50){
            color='background-color:#FF1493;';
        }
        if(val >= 50 && val < 75){
            color='background-color:#FFB6C1;';
        }
        if(val >= 75 && val < 85){
            color='background-color:#FFFF00;';
        }
        if(val >= 85 && val < 95){
            color='background-color:#ADFF2F;';
        }
        if(val >= 95 && val < 100){
            color='background-color:#9ACD32;';
        }
        if(val == 100){
            color='background-color:#228B22;';
        }
        return color;
    }


And this is how I'm calling it:

<apex:column headervalue="SitNum" style="{!color(defendNTAPNum[o.id])}">



Thank you for your feedback!