• Alok Khandelwal - Damco
  • 5 Points
  • Member since 2015
  • Practice Lead - Salesforce
  • Damco Solutions Pvt. Ltd.

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 8
Can anyone tell me how to apply external style sheets to visual force pages in Service Cloud to change font, font size and margins when rendering to PDF?
i have is_active__C checkbox on account object. so my requirment is on visualforce page i want to take one check box as 'show active accounts only'.when ever its checked i want to show active accounts only(which account checked while creating account record).otherwise show all accounts

on vf page i created one chekbok with name show active accounts and have one command button get accounts. if the chekbox is checked i want to show only active accounts
Can we create reports on all stanadard and custom objects?

Dear all:
I`m working on dynamic VF page which will show fields based on stages selected. Page works fine but the issue is with Probability field. While selecting Stage, Probability field does not show up value % associated at each level (like it generates for standard SF Opportunity page). Can one of you SF gurus please help in fixing this? Thanks!


<apex:page standardController="Opportunity" sidebar="false">

    <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/>
    <apex:form >
        <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>                
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    <apex:inputField value="{!opportunity.name}"/>
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Stage"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!opportunity.stageName}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock"
                            <apex:actionStatus startText="applying value..." id="status"/>
                    <apex:inputField value="{!opportunity.amount}"/>
                    <apex:inputField value="{!opportunity.closedate}"/>
                    <apex:inputField value="{!opportunity.Probability}"/>

            <apex:pageBlockSection title="Closed Lost Information" columns="1"
                                   rendered="{!opportunity.stageName == 'Closed Lost'}">
                <apex:inputField value="{!opportunity.Primary_Competitor__c}"  required="true"/>
                <apex:inputField value="{!opportunity.Reason_Lost__c}"/>
                <apex:inputField value="{!opportunity.OrderNumber__c}"/>
                <apex:inputField value="{!opportunity.TrackingNumber__c}"/>



Hi Experts,
As of now we are using timesheets for Weekly (Sun- Sat) basis.
Some of our consultants want to submit monthly timesheet. Please anyone advise the code for monthly.
Note: If anyone wants my monthly timesheet apex code I will mail you.
Please find below is the weekly timesheet.
Weekly TimeCard
Hi All,
I have two picklist fields Category__c and SubCust__c(dependent on Category__c field). How to display this field values using dynamic apex.
Need help how to display as dependent picklist.

User-added image
Hi all,

Please help !! i am new in salesforce.

Requirment is......

Field should be named Deal Demand Rating.  It'll be a color-coded picklist field with values of Green, Yellow and Red.  Make it conditional, so the default value is Green if the value of the Type field under related Account is set to Customer and Yellow if that condition is not satisfied.  However, the field should be editable by users, who can select another value from the picklist.

its urgent..please send me all steps....thanks if anyone can help me.
Created Apex class to show Case Tasks and Case Emails in chronological order on visualforce page. The problem is that I am not able to show fields on visualforce page, not sure where I am going wrong. Any help/pointers would be appreciated

Here is the Apex Class code

global with sharing class CaseEmailExtension {

  private final Case currentCase;

 public CaseEmailExtension(ApexPages.StandardController currentcase) {
    this.currentCase = (Case)currentcase.getRecord();
    global class commoncontainer implements Comparable {

    public DateTime createdDate{get;set;}

    public String content{get;set;}
    global Integer compareTo(Object compareTo) {
        commoncontainer compareToEmp = (commoncontainer)compareTo;
        if (createddate== compareToEmp.createddate) return 0;
        if (createddate> compareToEmp.createddate) return 1;
        return -1;        

  public List<commoncontainer> getSortcommoncontainer(){
    List <commoncontainer> containerlist = new List<commoncontainer>();
    for(EmailMessage emailmsg : getsortEmails())
    CommonContainer cc=new CommonContainer();
    cc.content='Subject:' + emailmsg.CreatedDate + 'From:' + emailmsg.FromAddress + 'To:' + emailmsg.ToAddress + 'BCC:' + emailmsg.BCCAddress + 'Subject:' + emailmsg.Subject + 'EmailBody:' + emailmsg.TextBody + 'CreatedBy:' + emailmsg.CreatedBy.Name;

    for(Attachment att: getattachments())
    CommonContainer cc=new CommonContainer();
    cc.content='Name:' + att.Name + 'Created By:' + att.CreatedBy.name;

    for(Task task: gettask())
    CommonContainer cc=new CommonContainer();
    cc.content='Assigned To:' + task.Who.Name + 'Created By:' + task.CreatedBy.name + 'Status:' + task.Status + 'Priority:' + task.Priority + 'Due Date:' + task.ActivityDate + 'Subject:' + task.Subject + 'Description' + task.Description;
   return containerlist; 

public List<EmailMessage> getSortEmails(){
    List <EmailMessage> sortedEmails = new List<EmailMessage>();
    sortedEmails = [SELECT Id, FromAddress, ToAddress, BCCAddress, CreatedDate, Subject, HasAttachment, Incoming, TextBody, CreatedBy.Name  
            from EmailMessage where ParentId =: currentCase.Id 
            order by MessageDate DESC ];
    return sortedEmails;

public List<Task> getTask() {
    List<Task> Task= new List<Task>();
    Task = [SELECT Id, Priority, Subject, Status, Description, CreatedDate, ActivityDate, CreatedBy.Name,Who.Name
            from Task order by CreatedDate DESC]; 
    return Task;  

Here is the Visualforce Page code

<apex:page standardController="Case" showHeader="false" sidebar="false" title="Case Number: {!Case.CaseNumber}" extensions="CaseEmailExtension">
<apex:form >
<apex:pageBlock title="Case Number: {!Case.CaseNumber}">

<apex:pageBlockButtons location="top" >
            <apex:CommandButton value="Print" onclick="javascript:window.print(); return false"/>
            <apex:CommandButton value="Close" onclick="window.close(); return false;"/>

<apex:repeat value="{!sortCommonContainer}" var="cc">

    <apex:pageblock >
    <apex:facet name="header">
        <apex:outputText value="{0,date,dd'.'MM'.'yyyy HH:mm:ss z}" style="font-weight:bold;font-style:italic;font-size:12px;float:left ">
        <apex:param value="{!cc.CreatedDate}" />
        <td width="100%" align="left">
            <table cellpadding="2px">