• Eric Fortenberry
  • NEWBIE
  • 0 Points
  • Member since 2012
  • CEO
  • OrgSync


  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 30
    Questions
  • 41
    Replies
Goal:  Build a real-time dashboard that auto updates when new cases are created and when cases are updated.  This dashboard will be displayed on an LCD montior that is hung on a wall in our office.  The page should stay alive indefiniately and not require signing in or refreshing.

I created a controller and visualforce page using ActionFunction (following the instructions in this article https://developer.salesforce.com/page/Streaming_Real_Time_Data_into_Visualforce (https://developer.salesforce.com/page/Streaming_Real_Time_Data_into_Visualforce" target="_blank)).

Everything works great for a little while, then the visualforce page stops updating.  I'm assuming my authentication is timing out, but I'm not completely sure.

To try to get around needing to be authenticated, I created a force.com site and made the page and controller available to the site.  I also made the static resouce cache control public.  However, the page does not update at all.  And even when I try to refresh the site, it doesnt update.

Any ideas on how I can accomplish my goal or why the public site is not working or even why my visualforce page does not continue to refresh after 15 minutes or so?


Hello, I have visualforce page with 3 columns and within each column there is one or mutliple pageBlocks that have either a chart or outputPanel.  For the first column I have two pageBlocks that have one chart in each.  I'd like to set both the chart heights to 50% of the screen height.  Is that possible?  

And same thing with the second and third columns, they have one pageBlock with one outputPanel that I'd like to set the height to 100% of the screen height.

Thanks for the help!

Is there a way to filter lookup dialog results based on certain criteria?  

 

So for example: 

I have a lookup relationship field for Products on a custom object for a Contact Product Association custom object.  When I click to lookup a product, I am shown all of our products.  I am trying to find a way to restrict the lookup dialog to only show me products in a certain pricebook.  Does anyone know how I could do that?

 

Thanks!

Does anyone know if there's any sort of reason why I wouldn't be able to render Task.Who.Phone and Task.Who.Email on a visualforce page? I tried to use an outputfield, but nothing shows up. Any ideas or guidance would be appreciated.
Does anyone know if it's possible to assign multiple contacts to a task within a visualforce page? I rebuilt our new / edit task page, but can't seem to figure out how to enable the shared activities. I'm wondering if it's not yet supported?

I have created an apex:chart and added a chartLabel to the barSeries; however, the labels are not centered over the bars.  Does anyone know how to fix this?  I can't seem to add a styleClass or use any sort of css.  Thanks!  

 

chart

 

<apex:pageBlockSection title="Future Tasks">
    <apex:chart height="250" width="800" data="{!
<apex:axis type="Category" position="bottom" fields="ActivityDate" title="Day of Month"> <apex:chartLabel orientation="vertical"/> </apex:axis> <apex:axis type="Numeric" position="left" fields="Total" title="Open Tasks"/> <apex:barSeries axis="bottom" orientation="vertical" xField="ActivityDate" yField="Total"> <apex:chartLabel display="outside" /> </apex:barSeries> </apex:chart> </apex:pageblocksection>

 

I'm trying to recreate as a visualforce chart a graph of Open Tasks by Date for the next 30 days.  We have this as a report and dashboard component, but I want to drop it on the Task creation page to help reps schedule future tasks on days where they don't have a lot of tasks.

 

Here's the current dashboard component with accurate data that I'm trying to replicate:

 

Correct chart

 

Here's what I'm currently seeing on my visualforce page:

 

Current visualforce page

 

Here's the visualforce code:

<apex:page controller="TaskChartController" title="Bar Chart">
    <apex:chart height="350" width="450" data="{!results}" >
        <apex:axis type="Category" position="bottom" fields="ActivityDate" title="Date"/>
        <apex:axis type="Numeric" position="left" fields="Total" title="Open Tasks"/>
        <apex:barSeries axis="bottom" orientation="vertical" xField="ActivityDate" yField="Total"/>
    </apex:chart>
    <apex:dataTable value="{!results}" var="ar">
        <apex:column headerValue="Open Tasks" value="{!ar.Total}"/>
        <apex:column headerValue="Date">
            <apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
                <apex:param value="{!ar.ActivityDate}"/>
            </apex:outputText>
        </apex:column>
    </apex:dataTable>
</apex:page>

 

Here's my apex controller code:

public class TaskChartController {

    public List<AggregateResult> lstAR = new List<AggregateResult>();
    
    public TaskChartController()
    {
        lstAR = [SELECT ActivityDate, COUNT(id) Total 
                FROM Task
                WHERE IsClosed = FALSE 
                AND ActivityDate = NEXT_N_DAYS:30
                GROUP BY ActivityDate];
    }
    
    public list<TaskClass> getResults()
    {
        list<TaskClass> lstResult = new List<TaskClass>();
        for (AggregateResult ar: lstAR)
        {
            taskClass objTaskClass = new taskClass(ar);
            lstResult.add(objTaskClass);
        }                       
        return lstResult;
    }
    
    class taskClass
    {
        public Integer Total
        {get; set;}
        
        public Date ActivityDate
        {get; set;}
            
        public taskClass(AggregateResult ar)
        {
            Total = (integer)ar.get('Total');
            ActivityDate = (Date)ar.get('ActivityDate');
        }
    }
}

 

So the issues I'm having are:

1)  Formatting the ActivityDate to MM-DD-YYYY on bottom axis. It seems ideal to do this in the controller... and to convert the date to a string, but I'm not exactly sure how to do that.

 

2)  Make sure all data columns are showing for the every date with data.  Right now only one column of data is showing.

 

Thanks for the help!

 

We have been using Salesforce Quotes for over six months now and today when I logged in to generate a quote, the images in the text/image field are no longer showing up.  We see the following broken image icons.  I have checked the image (uploaded in documents) and the externally available setting is still checked.  Literally nothing was changed, and the images are no longer working.  Any ideas would be appreciated it!

 

Quote template preview

 

Image settings

What is the best way to auto-populate the Account when clicking the Send Email button on the Contact's Activity History related list?  Right now it doesn't fill it in.  We'd like it to populate with the Account associated with the Contact.  Thanks for the help!

 

I have created a custom button to create a New Opportunity and I'd like to pass in the Account Name, but am not sure how.  Here is the code I have in my visualforce page.  I think I need to add additional paramaters to the !URLFOR part, but if someone could help me out I'd appreciate it!  Thanks.

 

<apex:page standardController="Account" extensions="AccountExt" sidebar="false" showHeader="false">
    <script>
      function doRedirect()
      {
       window.parent.location.href = '{!URLFOR($Action.Opportunity.New)}';
     }
    </script>
    <apex:form >
    <apex:pageBlock title="Opportunities">
        <apex:pageBlockButtons location="top">
            <apex:commandbutton onClick="doRedirect()" value="New Opportunity"/>
        </apex:pageBlockButtons>
        <apex:pageBlockTable value="{!AllOpportunities}" var="item">
            <apex:column headervalue="Opportunity Name">
                <apex:outputLink value="/{!item.Id}" target="_parent"><apex:outputField value="{!item.Name}" /></apex:outputLink>
            </apex:column>
            <apex:column value="{!item.StageName}" />               
            <apex:column value="{!item.Amount}" />
            <apex:column value="{!item.CloseDate}" />
            <apex:column value="{!item.OwnerId}" />
        </apex:pageBlockTable>
    </apex:pageBlock>  
    </apex:form>
</apex:page>

 

How would I sort AllOpenTasks and AllCompletedTasks ascending by ActivityDate?

 

AccountExt Class:

public class AccountExt {

    public AccountExt(ApexPages.StandardController controller) {
    acc = (Account) controller.getRecord();
    }
    private final Account acc;
    Set<id> AccountIds = new set<ID>();
    
    public void AccountIds(){
    	AccountIds.add(acc.Id);
        for(integer i=0;i<5;i++){
            for(Account a: [select Id from Account where ParentId in :AccountIds limit 45000])
            AccountIds.add(a.Id);
        }
    }
    
    public list<Contact> getAllContacts(){ 
        if(AccountIds.size()==0) AccountIds();
        return [select Name, Title, Account.Name, Phone, Email from Contact where AccountId in :AccountIds];
        }
	public list<Task> getAllOpenTasks(){ 
        if(AccountIds.size()==0) AccountIds();
        list<Task> tasks = [select Id, Subject, Type, Call_Notes__c, Account.Name, WhoID, ActivityDate, OwnerId from Task where AccountId in :AccountIds and IsClosed = False];
        return tasks;
        }
    public list<Task> getAllCompletedTasks(){ 
        if(AccountIds.size()==0) AccountIds();
        list<Task> tasks = [select Subject, Type, Call_Notes__c, Account.Name, WhoId, ActivityDate, OwnerId, Id from Task where AccountId in :AccountIds and Isclosed = true];
        return tasks;
        }
}

 

AllOpenTasks Visualforce Page:

<apex:page standardController="Account" extensions="AccountExt" sidebar="false" showHeader="false">
    <script>
      function doRedirect()
      {
       window.parent.location.href = '{!URLFOR($Action.Task.NewTask)}';
     }
    </script>
    <apex:form >
    <apex:pageBlock title="Open Tasks">
        <apex:pageBlockButtons location="top">
            <apex:commandbutton onClick="doRedirect()" value="New Task"/>
        </apex:pageBlockButtons>
        <apex:pageBlockTable value="{!AllOpenTasks}" var="item">
            <apex:column headervalue="Subject">
                <apex:outputLink value="/{!item.Id}" target="_parent"><apex:outputField value="{!item.Subject}" /></apex:outputLink>
            </apex:column>
            <apex:column value="{!item.Type}" />
            <apex:column value="{!item.Call_Notes__c}" />
            <apex:column value="{!item.Account.Name}" />            
            <apex:column value="{!item.WhoId}" />
            <apex:column value="{!item.ActivityDate}" />
            <apex:column value="{!item.OwnerId}" />
        </apex:pageBlockTable>
    </apex:pageBlock>  
    </apex:form>
</apex:page>

 

AllCompletedTasks VisualForce Page:

<apex:page standardController="Account" extensions="AccountExt" sidebar="false" showHeader="false">
    <script>
      function doRedirect()
      {
       window.parent.location.href = '{!URLFOR($Action.Task.NewTask)}';
     }
    </script>
    <apex:form >
    <apex:pageBlock title="Open Tasks">
        <apex:pageBlockButtons location="top">
            <apex:commandbutton onClick="doRedirect()" value="New Task"/>
        </apex:pageBlockButtons>
        <apex:pageBlockTable value="{!AllOpenTasks}" var="item">
            <apex:column headervalue="Subject">
                <apex:outputLink value="/{!item.Id}" target="_parent"><apex:outputField value="{!item.Subject}" /></apex:outputLink>
            </apex:column>
            <apex:column value="{!item.Type}" />
            <apex:column value="{!item.Call_Notes__c}" />
            <apex:column value="{!item.Account.Name}" />            
            <apex:column value="{!item.WhoId}" />
            <apex:column value="{!item.ActivityDate}" />
            <apex:column value="{!item.OwnerId}" />
        </apex:pageBlockTable>
    </apex:pageBlock>  
    </apex:form>
</apex:page>

 

How can I generate a report of all contacts without open activities?  I've tried multiple of the standard reports and can't seem to make this happen.  Any ideas would be much appreciated!  

I would like to add a field to our Accounts that equals the account name up until there is a dash '-'.  We do not want anything after the dash to be in this new field.  How can I do that?  I've created a new custom field, but am not sure how to write the formula to accomplish this.  Thanks for the help!

I would like to import leads with two phone numbers, direct phone and other phone.  Direct phone will be the standard phone field and I created a custom field for other phone.  After that when I tried to map the custom other phone to contacts other phone I was not able to because Other Phone on the Contact is a standard field.  What is the best way to update the Other Phone number on the Contact when converting the lead?

I just stumbled across the new Social Accounts and Contacts feature (at the button of the Setup --> Customization list) and it looks interesting.  The Facebook integration doesnt do much because it doesnt show the user's feed, just bio and info.  The Twitter integration looks good though because it show the most recent tweets.  And when I clicked on the LinkedIn icon, I was prompted to upgrade to LinkedIn for Salesforce, which promised to provide "insight to close deals faster for the entire team."  I'm curious if anyone has tried this premium upgrade and how well it work?

 

You can check out their packages and pricing here by logging in (or screenshot below):  http://www.linkedin.com/subscriptionv2?displaySalesProduct&source=sfdc&trk=sfdc

 

When creating a new opportunities, I would like to automatically update the Close Date field based on the Stage field.  Ideally, it would work the same way the Probability (%) field is automatically updated when the Stage is selected?  The close date should be set to Today () + the number of days as defined below for each stage:  

 

Stage 1 - 360 days

Stage 2 - 180 days

Stage 3 - 90 days

Stage 4 - 30 days

 

Thanks for the help!

Does anyone know of any best practices for creating and tracking PDF invoices?  I'd like them to work just like quotes, which we are using to generate our order forms with, however, I'd like them to have their own related list section on the opportunity.  I'm not sure if there is a way to extend or modify quotes to handle this, or if I should try to use something like Simple quote/invoice/order.  All suggestions and ideas are appreciated.  Thanks!

Is there a way to rename Quotes to Order Forms & Invoices?

 

Thanks,

Is there anyway to customize the quote templates beyond just using the template editor?  For example, I'd like to add additional spacing and lines to certain sections.  Is there anyway to edit these templates like visualforce page?

Hi All,

 

I just setup Products and Quotes to work with opportunities and now I'd like to start using Contracts.  Can anyone point me at some good documentation and/or video tutorials?  It seems like there is less documentation about contracts than quotes and products.  Ultimately, when I close an opportunity I'd like that to generate a contract that we could send as an Invoice.  Thanks for the help.

I have created an apex:chart and added a chartLabel to the barSeries; however, the labels are not centered over the bars.  Does anyone know how to fix this?  I can't seem to add a styleClass or use any sort of css.  Thanks!  

 

chart

 

<apex:pageBlockSection title="Future Tasks">
    <apex:chart height="250" width="800" data="{!
<apex:axis type="Category" position="bottom" fields="ActivityDate" title="Day of Month"> <apex:chartLabel orientation="vertical"/> </apex:axis> <apex:axis type="Numeric" position="left" fields="Total" title="Open Tasks"/> <apex:barSeries axis="bottom" orientation="vertical" xField="ActivityDate" yField="Total"> <apex:chartLabel display="outside" /> </apex:barSeries> </apex:chart> </apex:pageblocksection>

 

Goal:  Build a real-time dashboard that auto updates when new cases are created and when cases are updated.  This dashboard will be displayed on an LCD montior that is hung on a wall in our office.  The page should stay alive indefiniately and not require signing in or refreshing.

I created a controller and visualforce page using ActionFunction (following the instructions in this article https://developer.salesforce.com/page/Streaming_Real_Time_Data_into_Visualforce (https://developer.salesforce.com/page/Streaming_Real_Time_Data_into_Visualforce" target="_blank)).

Everything works great for a little while, then the visualforce page stops updating.  I'm assuming my authentication is timing out, but I'm not completely sure.

To try to get around needing to be authenticated, I created a force.com site and made the page and controller available to the site.  I also made the static resouce cache control public.  However, the page does not update at all.  And even when I try to refresh the site, it doesnt update.

Any ideas on how I can accomplish my goal or why the public site is not working or even why my visualforce page does not continue to refresh after 15 minutes or so?


Hello, I have visualforce page with 3 columns and within each column there is one or mutliple pageBlocks that have either a chart or outputPanel.  For the first column I have two pageBlocks that have one chart in each.  I'd like to set both the chart heights to 50% of the screen height.  Is that possible?  

And same thing with the second and third columns, they have one pageBlock with one outputPanel that I'd like to set the height to 100% of the screen height.

Thanks for the help!
Does anyone know if there's any sort of reason why I wouldn't be able to render Task.Who.Phone and Task.Who.Email on a visualforce page? I tried to use an outputfield, but nothing shows up. Any ideas or guidance would be appreciated.
Does anyone know if it's possible to assign multiple contacts to a task within a visualforce page? I rebuilt our new / edit task page, but can't seem to figure out how to enable the shared activities. I'm wondering if it's not yet supported?

I'm trying to recreate as a visualforce chart a graph of Open Tasks by Date for the next 30 days.  We have this as a report and dashboard component, but I want to drop it on the Task creation page to help reps schedule future tasks on days where they don't have a lot of tasks.

 

Here's the current dashboard component with accurate data that I'm trying to replicate:

 

Correct chart

 

Here's what I'm currently seeing on my visualforce page:

 

Current visualforce page

 

Here's the visualforce code:

<apex:page controller="TaskChartController" title="Bar Chart">
    <apex:chart height="350" width="450" data="{!results}" >
        <apex:axis type="Category" position="bottom" fields="ActivityDate" title="Date"/>
        <apex:axis type="Numeric" position="left" fields="Total" title="Open Tasks"/>
        <apex:barSeries axis="bottom" orientation="vertical" xField="ActivityDate" yField="Total"/>
    </apex:chart>
    <apex:dataTable value="{!results}" var="ar">
        <apex:column headerValue="Open Tasks" value="{!ar.Total}"/>
        <apex:column headerValue="Date">
            <apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
                <apex:param value="{!ar.ActivityDate}"/>
            </apex:outputText>
        </apex:column>
    </apex:dataTable>
</apex:page>

 

Here's my apex controller code:

public class TaskChartController {

    public List<AggregateResult> lstAR = new List<AggregateResult>();
    
    public TaskChartController()
    {
        lstAR = [SELECT ActivityDate, COUNT(id) Total 
                FROM Task
                WHERE IsClosed = FALSE 
                AND ActivityDate = NEXT_N_DAYS:30
                GROUP BY ActivityDate];
    }
    
    public list<TaskClass> getResults()
    {
        list<TaskClass> lstResult = new List<TaskClass>();
        for (AggregateResult ar: lstAR)
        {
            taskClass objTaskClass = new taskClass(ar);
            lstResult.add(objTaskClass);
        }                       
        return lstResult;
    }
    
    class taskClass
    {
        public Integer Total
        {get; set;}
        
        public Date ActivityDate
        {get; set;}
            
        public taskClass(AggregateResult ar)
        {
            Total = (integer)ar.get('Total');
            ActivityDate = (Date)ar.get('ActivityDate');
        }
    }
}

 

So the issues I'm having are:

1)  Formatting the ActivityDate to MM-DD-YYYY on bottom axis. It seems ideal to do this in the controller... and to convert the date to a string, but I'm not exactly sure how to do that.

 

2)  Make sure all data columns are showing for the every date with data.  Right now only one column of data is showing.

 

Thanks for the help!

 

We have been using Salesforce Quotes for over six months now and today when I logged in to generate a quote, the images in the text/image field are no longer showing up.  We see the following broken image icons.  I have checked the image (uploaded in documents) and the externally available setting is still checked.  Literally nothing was changed, and the images are no longer working.  Any ideas would be appreciated it!

 

Quote template preview

 

Image settings

What is the best way to auto-populate the Account when clicking the Send Email button on the Contact's Activity History related list?  Right now it doesn't fill it in.  We'd like it to populate with the Account associated with the Contact.  Thanks for the help!

 

I have created a custom button to create a New Opportunity and I'd like to pass in the Account Name, but am not sure how.  Here is the code I have in my visualforce page.  I think I need to add additional paramaters to the !URLFOR part, but if someone could help me out I'd appreciate it!  Thanks.

 

<apex:page standardController="Account" extensions="AccountExt" sidebar="false" showHeader="false">
    <script>
      function doRedirect()
      {
       window.parent.location.href = '{!URLFOR($Action.Opportunity.New)}';
     }
    </script>
    <apex:form >
    <apex:pageBlock title="Opportunities">
        <apex:pageBlockButtons location="top">
            <apex:commandbutton onClick="doRedirect()" value="New Opportunity"/>
        </apex:pageBlockButtons>
        <apex:pageBlockTable value="{!AllOpportunities}" var="item">
            <apex:column headervalue="Opportunity Name">
                <apex:outputLink value="/{!item.Id}" target="_parent"><apex:outputField value="{!item.Name}" /></apex:outputLink>
            </apex:column>
            <apex:column value="{!item.StageName}" />               
            <apex:column value="{!item.Amount}" />
            <apex:column value="{!item.CloseDate}" />
            <apex:column value="{!item.OwnerId}" />
        </apex:pageBlockTable>
    </apex:pageBlock>  
    </apex:form>
</apex:page>

 

How can I generate a report of all contacts without open activities?  I've tried multiple of the standard reports and can't seem to make this happen.  Any ideas would be much appreciated!  

I would like to add a field to our Accounts that equals the account name up until there is a dash '-'.  We do not want anything after the dash to be in this new field.  How can I do that?  I've created a new custom field, but am not sure how to write the formula to accomplish this.  Thanks for the help!

When I tried {!$Resource.resources_name} in my Site's VF pages, I see the "/resource/..." URL, which does not work for the host address of my Site.  All I see, for example for images, are broken image icons.  If I take the relative URL supplied by the {!$Resource...} and put it on the hostname of my Salesforce instance when logged into Salesforce proper, it works fine. I know that all permissions are properly set for the Site guest user profile (unless I missed a specific one for static resources somewhere).  I did set the caching for each resource to public.   If I am logged into Salesforce proper and looking at my Site, that s the only way I can see the static resources. Of course, my future customers will not be able to see them.

 

Any suggestions?

Hi All,

 

I have a requirement to show # of open Task on Lead Detailpage. Below is the logic that we are planning to implement. I would like tocheck with you if any one has implemented similar functionality handling BULK insert/update.If so could you please share the code?

 

Trigger on Task <after insert after update>

 

{

    for (Task thistask : Trigger.new)

      {

    // Get all leads assosited to Tasks

    if (WhoId.startsWith('00Q'))               

      leadIdToUpdateList.add(taskWhoId.WhoId);

     }

 

FOR each Lead

           SelectCount() from Task where whoId=LeadId and Status=Completed

           Updatecustom field “ Open Task” on  Lead object

End Loop   

 

}

 

Thank You .