• Pankaj Gupta 94
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Amount Earned Font should show color as per the directives defined    
Amount Invested > Amount Earned    Color is RED,
If  Amount Invested = Amount Earned color is BLUE and
If Amount Invested < Amount Earned    color is GREEN

I have defined the fields as 
<apex:inputField value="{!newContact.Amount_Invested__c}" required="true"/>
<apex:inputField value="{!newContact.Amount_Earned__c}" required="true"/>
I have Visualforce page  with below code
<apex:page controller="assign_1_Controller">
<apex:pageBlock >
    <apex:form >
   <apex:pageBlockSection columns="1">
        <apex:inputField value="{!newCase.ContactId}" label="Search Contact">      
        </apex:inputField>
        
        <apex:commandButton value="Go" title="Go" action="{!go}"/>
        
        <!-- <apex:commandButton value="Add New Contact" title="Add New Contact" action="{!addNewContact}"/> -->
        </apex:pageBlockSection>
    </apex:form>
    </apex:pageBlock>
</apex:page>
and 

Controller
public Contact contactbyLookup{get;set;}
public PageReference go(){
        PageReference p = new PageReference('/apex/Casetabsearchassignment');
        if(newCase.ContactId != null){
        contactByLookup = [select id,
                                  Name,
                                  Business_Vertical__c  
                                  from Contact 
                                  where id =: newCase.ContactId];
    
        }
        return p;
    }
 
I have Visualforce page  with below code
<apex:page controller="assign_1_Controller">
<apex:pageBlock >
    <apex:form >
   <apex:pageBlockSection columns="1">
        <apex:inputField value="{!newCase.ContactId}" label="Search Contact">      
        </apex:inputField>
        
        <apex:commandButton value="Go" title="Go" action="{!go}"/>
        
        <!-- <apex:commandButton value="Add New Contact" title="Add New Contact" action="{!addNewContact}"/> -->
        </apex:pageBlockSection>
    </apex:form>
    </apex:pageBlock>
</apex:page>
and 

Controller
public Contact contactbyLookup{get;set;}
public PageReference go(){
        PageReference p = new PageReference('/apex/Casetabsearchassignment');
        if(newCase.ContactId != null){
        contactByLookup = [select id,
                                  Name,
                                  Business_Vertical__c  
                                  from Contact 
                                  where id =: newCase.ContactId];
    
        }
        return p;
    }