i want to assign different background color based on date...for example four row having the same date it should be shown in the Same color. ----->thanks in advance <--
here i have attached screenshot and coding also .... could you please rectify this . here i need output as per mentioned above screenshot , i need all the records based on the inspection date (recently created date should be show top of the record EX- i have three records , 18/04/2016 , 17/04./2016 , 19/04/2016 . here 19/04/2016 wil show top of the page )
private ApexPages.StandardController controller {get; set;} public Map<id,Inspection_Sheet__c> Inspec; public Inspection_Sheet__c VisName{get;set;} public Visit__c VisitId{get;set;} public Map<id,List<System_Type__c>> systemType {get;set;} public List<Other_System__c> otherSystem {get;set;} public id propertyId; public List<System_Type__c> SortType{get;set;}
public PreviousVisitAllCertificate(ApexPages.StandardController controller) { //Inspec=new Map<Id,Inspection_Sheet__c>(); SortType=new List<System_Type__c>(); systemType=new Map<id,List<System_Type__c>>(); VisName=[select Visit__r.Name,Porperty_Id__c from Inspection_Sheet__c where id=:ApexPages.CurrentPage().getparameters().get('id')]; if(VisName!=null){ propertyId=(Id)VisName.Porperty_Id__c; VisitId=[select id,Name,Property__c from Visit__c where Property__c=:propertyId AND Name<:VisName.Visit__r.Name order by createddate desc limit 1]; } if(VisitId!=null){
Inspec=new Map<Id,Inspection_Sheet__c>([select id,Name,Date__c from Inspection_Sheet__c where Visit__c in(select id from Visit__c where id=:VisitId.id) ORDER BY Date__c]);
SortType=[SELECT id,Name,Building__c,System_Location__c,System_Type__c,Type__c,createdDate,Pass__c,Fail__c,Inspection_Sheet__r.Date__c FROM System_Type__c WHERE Inspection_Sheet__c in:(Inspec.keyset()) order by Inspection_Sheet__r.Date__c desc];
style="{!IF(object.field != 5,'background-color:green;',background-color:red;')}"
here i have attached screenshot and coding also .... could you please rectify this . here i need output as per mentioned above screenshot , i need all the records based on the inspection date (recently created date should be show top of the record EX- i have three records , 18/04/2016 , 17/04./2016 , 19/04/2016 . here 19/04/2016 wil show top of the page )
@VF Page
<apex:page showHeader="false" tabstyle="Quote__c" extensions="PreviousVisitAllCertificate" standardController="Inspection_Sheet__c">
<!--<style>
tr:nth-child(even) {background: #DBE5F1}
</style>-->
<apex:form >
<apex:pageblock >
<apex:pageblockSection columns="1" >
<apex:facet name="header">System Types</apex:facet>
<apex:variable var="i" value="{!0}"/>
<apex:repeat value="{!systemType}" var="Systype">
<apex:outputLabel >{!Systype}</apex:outputLabel>
<apex:variable var="i" value="{!i+1}"/>
<apex:pageBlockTable value="{!systemType[Systype]}" var="Sys" style="background-color:{! IF((mod(i,2)) == 1,'#DBE5F1','#FDE9D9')};">
<apex:column value="{!Sys.Inspection_Sheet__r.Date__c}" headerClass="headerStyle" headerValue="Inspection Date" />
<apex:column value="{!Sys.Name}" headerClass="headerStyle"/>
<apex:column value="{!Sys.Building__c}" headerClass="headerStyle"/>
<apex:column value="{!Sys.System_Type__c}" headerClass="headerStyle"/>
<apex:column value="{!Sys.Type__c }" headerClass="headerStyle"/>
<apex:column value="{!Sys.System_Location__c}" headerClass="headerStyle"/>
<apex:column value="{!Sys.Pass__c}" headerClass="headerStyle"/>
<apex:column value="{!Sys.Fail__c}" headerClass="headerStyle"/>
</apex:pageBlockTable>
</apex:repeat>
<apex:outputLabel >{!systemType}</apex:outputLabel>
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
@Controler
public class PreviousVisitAllCertificate{
private ApexPages.StandardController controller {get; set;}
public Map<id,Inspection_Sheet__c> Inspec;
public Inspection_Sheet__c VisName{get;set;}
public Visit__c VisitId{get;set;}
public Map<id,List<System_Type__c>> systemType {get;set;}
public List<Other_System__c> otherSystem {get;set;}
public id propertyId;
public List<System_Type__c> SortType{get;set;}
public PreviousVisitAllCertificate(ApexPages.StandardController controller) {
//Inspec=new Map<Id,Inspection_Sheet__c>();
SortType=new List<System_Type__c>();
systemType=new Map<id,List<System_Type__c>>();
VisName=[select Visit__r.Name,Porperty_Id__c from Inspection_Sheet__c where id=:ApexPages.CurrentPage().getparameters().get('id')];
if(VisName!=null){
propertyId=(Id)VisName.Porperty_Id__c;
VisitId=[select id,Name,Property__c from Visit__c where Property__c=:propertyId AND Name<:VisName.Visit__r.Name order by createddate desc limit 1];
}
if(VisitId!=null){
Inspec=new Map<Id,Inspection_Sheet__c>([select id,Name,Date__c from Inspection_Sheet__c where Visit__c in(select id from Visit__c where id=:VisitId.id) ORDER BY Date__c]);
SortType=[SELECT id,Name,Building__c,System_Location__c,System_Type__c,Type__c,createdDate,Pass__c,Fail__c,Inspection_Sheet__r.Date__c FROM System_Type__c WHERE Inspection_Sheet__c in:(Inspec.keyset()) order by Inspection_Sheet__r.Date__c desc];
system.debug('>>>>>'+SortType);
for(System_Type__c Sys: SortType){
if(systemType.containskey(Sys.Inspection_Sheet__c)){
systemType.get(Sys.Inspection_Sheet__c).add(Sys);
}
else{
systemType.put(Sys.Inspection_Sheet__c,new List<System_Type__c>{Sys});
}
}
}
}
}