• Soul Ages
  • NEWBIE
  • 50 Points
  • Member since 2011


  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 14
    Replies

 

         System.Debug('Lead Date is ' + Leads[0].Last_Visit_Date__c);
         System.Debug('Task Date is ' + Tasks[0].Last_Visit_Date__c );
         System.ASSERT(Tasks[0].Last_Visit_Date__c == Leads[0].Last_Visit_Date__c); 



In the debug log, I see that the two date/times are equal.

 

09:14:49.039 (5039665000)|USER_DEBUG|[39]|DEBUG|Lead Date is 2011-06-13 16:14:45
09:14:49.039 (5039832000)|USER_DEBUG|[40]|DEBUG|Task Date is 2011-06-13 16:14:45
09:14:49.040 (5040367000)|EXCEPTION_THROWN|[46]|System.AssertException: Assertion Failed
09:14:49.040 (5040601000)|FATAL_ERROR|System.AssertException: Assertion Failed

 

I have excluded other code, but this is in test method. I have a trigger  on lead which updates the task associated with that lead and sets the last visit date.

In the test method, I set the last visit date on Lead and update the lead. I query the database for all tasks associated with that lead and do the assert


 

 

After having most test failed suddenly for no apparent reason, we found that the culprit was that a field we were using to search for a special user was changed to be unique. 

User[] users = [select id from User where Unique_Field___c = :'Special' limit 1];
System.assert(users.size()>0, 'Missing Special user configuration.');

 If I run the code in a test method, I get 'Missing Special user configuration.' assert exception. If I run it in a developer console, it runs without the assert triggering.

Any ideas why is this? Is it a bug or feature? Is it documented anywhere?

I have a VF page where I'm using inputField with the ActivityDate field. The problem is that the Calendar is popping up when the page renders even when the field is not the first element in the page. Any ideas on how to make other field selected on page render?

Hello SalesForce Developers! :)
I'm looking for SalesForce Developer - this is the best offer in Europe! :) My client from Warsaw needs people with experience, and I think this is good proposal for you.
This is fully remote job, so you can work at home! What do you think about it? :)
 
Regards,
Please contact me on: karolina.grunwald@seargin.com

I want to display google charts in tab panel ther i am getting an error that is "Cannot read property 'length' of undefined" that type of error . Can any one tell me how can i display google charts in apex Tab Panel.

I've been able to get Google Visualization Charts to work fine on several pages, but when it comes to pages with TabPanels, the entire browser hangs when the chart is drawn.  Google's code gets stuck in some sort of race condition. If I remove the TabPanel it works fine again.  Can anyone help me with a work around?

 

<apex:page sidebar="false" >
  <h1>Google Chart Test</h1>

  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);

        var options = {
          title: 'Company Performance',
          vAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
  </script>
  <apex:tabPanel title="myTab" switchType="server">
    <apex:tab >
      <div id="chart_div" style="width: 900px; height: 500px;"></div>
    </apex:tab>
  </apex:tabPanel>
</apex:page>

 

 

 

 

 

After having most test failed suddenly for no apparent reason, we found that the culprit was that a field we were using to search for a special user was changed to be unique. 

User[] users = [select id from User where Unique_Field___c = :'Special' limit 1];
System.assert(users.size()>0, 'Missing Special user configuration.');

 If I run the code in a test method, I get 'Missing Special user configuration.' assert exception. If I run it in a developer console, it runs without the assert triggering.

Any ideas why is this? Is it a bug or feature? Is it documented anywhere?

I have a VF page where I'm using inputField with the ActivityDate field. The problem is that the Calendar is popping up when the page renders even when the field is not the first element in the page. Any ideas on how to make other field selected on page render?

Hello, 

 

I have a problem with creating charts using the new feature from the Winter 13 release.  Using a SOQL query in a controller extension I can get the data to populate a line or bar chart on the page, no probelm.  However, when I put the chart into a Tab in a tabPanel block, it fails to create the chart if the following is true:

 

- When the chart is not on the first tab to be selected ( <apex:tabPanel selectedTab="notChartTab" ...)

- When the tab panel switch type is not set to server ( <apex:tabPanel switchType="client" ...)

 

I tested this in Firefox 15 and IE9.

 

Using the switch type 'server' is probably the better workaround, as this page is for an Account with the customer support case graph under a 'support' tab, the first tab being for the account details.  But using the 'server' setting makes moving from tab to tab very slow/unresponsive and therefore undesirable.  

 

I have also tried to use the <apex:tab rerender='chartid' ...   to see if that allows the chart to be drawn when the tab is selcted, but no luck.

 

Sorry if this has been covered before, but I think my question is slightly different than most. I have a visualforce page which is going to replace the Open Activities and Activity History related lists on Leads and Contacts with in-line visualforce pages. This is so I can seperate them bases on type and other factors. 

 

What I don't want to change is the standard buttons like New Task, New Event, Log A Call and so on. Is there an easy way to use those standard buttons but not recreate them as a custom button? I can recreate a button like New Task, but only if it points to a specific record type. When I try to recreate the exact nature of the standard button, taking use to record type selection first it doesnt seem to work out.

  • October 04, 2012
  • Like
  • 0

 

         System.Debug('Lead Date is ' + Leads[0].Last_Visit_Date__c);
         System.Debug('Task Date is ' + Tasks[0].Last_Visit_Date__c );
         System.ASSERT(Tasks[0].Last_Visit_Date__c == Leads[0].Last_Visit_Date__c); 



In the debug log, I see that the two date/times are equal.

 

09:14:49.039 (5039665000)|USER_DEBUG|[39]|DEBUG|Lead Date is 2011-06-13 16:14:45
09:14:49.039 (5039832000)|USER_DEBUG|[40]|DEBUG|Task Date is 2011-06-13 16:14:45
09:14:49.040 (5040367000)|EXCEPTION_THROWN|[46]|System.AssertException: Assertion Failed
09:14:49.040 (5040601000)|FATAL_ERROR|System.AssertException: Assertion Failed

 

I have excluded other code, but this is in test method. I have a trigger  on lead which updates the task associated with that lead and sets the last visit date.

In the test method, I set the last visit date on Lead and update the lead. I query the database for all tasks associated with that lead and do the assert


 

 

im working on integrating salesforce with my companies crm software.  i have created a button in the salesforce campaign tab that alllows a user to upload all the members of the campaign to my companies database. My issues arise when a user tries to upload a campaign that is bigger than the 10000 row limit for soql queries.  im looking for some advice on how i would be able to get more than 10000 rows of data from salesforce.

Hi everyone,

 

I just written apex class which implements schedulable interface, i want to run that apex class only on my bussiness hours

How to schedule that class?

 

Thanks,

Karan

For some reason, I have to catch the event when a user is leaving a visualforce page (closing the page, clicking on another link, ...) and execute a method of my controller.

The idea was to use something like window.onbeforeunload = function(){ Unload();return false} which should call the function "unload()". It's working pretty well when I replace the "Unload()" with a javascript alert, meaning the function is executed but the aim is to call the controller... So I have a simple actionfunction  <apex:actionFunction action="{!OnUnload}" name="Unload"/> which should call the method "OnUnload" in my controller. Unfortunately, it is not working... It's not the first time I'm using actionfunction called from Javascript but it looks like that the line "actionfunction" is already "unloaded" even on "onbeforeunload" :/

Has someone already been confronted to this problem ?? 

I've been able to get Google Visualization Charts to work fine on several pages, but when it comes to pages with TabPanels, the entire browser hangs when the chart is drawn.  Google's code gets stuck in some sort of race condition. If I remove the TabPanel it works fine again.  Can anyone help me with a work around?

 

<apex:page sidebar="false" >
  <h1>Google Chart Test</h1>

  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);

        var options = {
          title: 'Company Performance',
          vAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
  </script>
  <apex:tabPanel title="myTab" switchType="server">
    <apex:tab >
      <div id="chart_div" style="width: 900px; height: 500px;"></div>
    </apex:tab>
  </apex:tabPanel>
</apex:page>