• Kevin Languedoc
  • NEWBIE
  • 115 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 34
    Replies
I am trying to run a test but I keep getting the same error that the Address field is empty or missing. When I add a !Test,isRunning I get the following error msg. But the actual class works beautifully in dev. I am trying to get my test coverage up and apply the proper unit test. The actual class is below.

This is the test class

Error message:

 You cannot call addFields when the data is being passed into the controller by the caller.

OR:

13:33:29:311 FATAL_ERROR System.EmailException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Missing target address (target, to, cc, bcc): []

when I add the following code
 
if(!Test.isRunningTest()){
             sc.addFields(new List<String>{'CaseAssignedOwner__c'});
        }

@isTest
public class testCaseForm1747SendMail {
    static testMethod void testSend(){
       
        Case testCase = new Case();
        testCase.Subject = 'unittest';
        testCase.Description = 'unit test description';
        testCase.CaseAssignedOwner__c = 'klanguedoc@jdi.jubl.com';
        testCase.Case_Category__c = 'Product Enquiry';
        insert testCase;
            
        ApexPages.StandardController sc = new ApexPages.StandardController(testCase);
        // test constructor;
        // testCaseForm1747SendMail

        
       
    
        CaseForm1747SendMail Send1747 = new CaseForm1747SendMail(sc);
        sc.addFields(new List<String>{'CaseAssignedOwner__c'});
       
        send1747.send();
        
        
    }
}

Actual class : works fine
 
public class CaseForm1747SendMail {
    private final Case c;
    public CaseForm1747SendMail(ApexPages.StandardController stdCrlr){
   		if (!Test.isRunningTest()) { 
            stdCrlr.addFields(new List<String>{'CaseAssignedOwner__c'});

        }           
        this.c = (Case)stdCrlr.getRecord();
       
        
    }
    public Case getCase(){
        return c;
    }
   
     public PageReference send() {
        // Define the email
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 

        // Reference the attachment page and pass in the case ID
        PageReference pdf =  Page.SendQA1747asPDF;
        pdf.getParameters().put('id',(String)c.id); 
        pdf.setRedirect(true);

        // Take the PDF content
        //Blob b = pdf.getContent();
         Blob b = Test.isRunningTest() ? Blob.valueOf('UNIT.TEST') : pdf.getContent();

        // Create the email attachment
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setFileName(c.CaseNumber + '.pdf');
        efa.setBody(b);
        String[] toAddresses = new List<String>();
        Case_Owner__c[] assignedOwner = new List<Case_Owner__c>();

		System.debug(c.CaseAssignedOwner__c);
       assignedOwner =  [select  MemberEmail__c from Case_Owner__c where Queues__c = : c.CaseAssignedOwner__c ];
         for(Case_Owner__c em : assignedOwner){
            toAddresses.add(String.valueOf(em.MemberEmail__c));
         }
       System.debug(toAddresses);
       
        email.setSubject( c.Subject );
             
        email.setToAddresses( toAddresses );
        email.setPlainTextBody( c.Description );

        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

        // Sends the email
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        
        PageReference casePage = new ApexPages.StandardController(c).view();
        casePage.setRedirect(true);
        
        List<Task> tasks = new List<Task>();
        tasks.add(new Task(
    ActivityDate = Date.today(),
    Subject='Envoyé formulaire 1747 pour le Case ' + c.CaseNumber,
    WhatId = c.Id,
    OwnerId = UserInfo.getUserId(),
    Status='Complété - Completed'));

insert tasks;
        return null;
    }
    
}

 
I need to test the communication between javascript in a VF page that is rendered from a button on a open case document and an Apex webservice that is supposed to send an e-mail. However I get the impression that the web service is never called. So I created a small dummy webservice, called WSReturn to receive a name and return a string. I am trying to dtermine if the problem is in the javascript code or the Apex code.

Browser: Chrome, Version 42.0.2311.90 (64-bit) on a Mac
The javascript function sayHelloService is called on the window.onload event. However I am getting this error message:

Refused to set unsafe header "User-Agent"
send @ connection.js:593
sforce.SoapTransport.send @ connection.js:1012
sforce.Connection._invoke @ connection.js:1727
sforce.Apex.execute @ apex.js:60
sayHelloService @ Form1747web?scontrolCaching=1&id=50055000000fkiR&isdtp=vw&nonce=dcb74e9d3d4fd43461bc263b172a1a02c72…:41

Javascript code:
function sayHelloService(){
                  var hello = sforce.apex.execute("WSReturn", "Hello", {name:'Kevin'}); 
                  sforce.debug.log(hello);
               }



Apex Code:
global class WSReturn {
    
    webservice static String Hello(String name){
        String sayHello;
        
        sayHello = 'Hi ' + name;
        System.debug('sayHello');
        
        return sayHello;
        
        
    }

}

 
https://login.salesforce.com/17181/logo180.png
Failed to load resource: the server responded with a status of 404 (Not Found)

When I load a VF page of a open case, in the Javascript console, the first line of the output has this error. The instructions at the url says to contact support to fix the issue because the resource no longer exists.
I have this code and I am not sure to test. Do I need to replace the SELECT by an actual Case id? Do I need to create a case via Apex and populate to required fiedls to send page as pdf?
 
public class Form1747MailerController {
	 
    private Case c;
  
    
    
    public Form1747MailerController(){
        c = [SELECT id, CaseNumber, Subject, Description FROM Case WHERE Id = :ApexPages.currentPage().getParameters().get('id')  ];
    }
    
  	public void SendPDF(){
        String[] sendToAddr;
        sendToAddr[0] = c.CaseAssignedOwner__c;
  		Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage();
  		PageReference pr = Page.Form1747web;
        pr.getParameters().put('id', c.Id);
        pr.setRedirect(true);
        Blob docBlob = pr.getContent();
        
        Messaging.EmailFileAttachment emailatt = new Messaging.EmailFileAttachment();
        emailatt.setFileName(c.CaseNumber);
        emailatt.setBody(docBlob);
        
        msg.setSubject(c.Subject);
        msg.setPlainTextBody(c.Description);
        msg.setToAddresses(sendToAddr);
        
        msg.setFileAttachments(new Messaging.EmailFileAttachment[]{emailatt});
      
  		List<Messaging.SendEmailResult> results = 
    					Messaging.sendEmail(new Messaging.Email[] { msg });
		if (!results.get(0).isSuccess()) {
    			System.StatusCode statusCode = results.get(0).getErrors()[0].getStatusCode();
    		String errorMessage = results.get(0).getErrors()[0].getMessage();
		} 	
        
  }
      
}

 
I am trying to apply CSS styling rules to a Visualforce page. My ultimate goal is to generate a PDF from the page using the renderAs="pdf" (which is not included here because I am trying to isolate the problem).

I have tried creating an external stylesheet using the the various tutorials on developer.force.com pages without any success. These stylesheets were added to the SFDC via static resources as you can see from the code below. However the styling is not rendered.

I also tried apply inline styling to test and again this is not rendered.

I am testing in the Sandbox PRO in my org using API 33. I tried other API versions but got the same results.

Can anyone provide some clues on how to fix the issue

<apex:page showHeader="false" applyHtmlTag="false">
 <apex:stylesheet value="{!URLFOR($Resource.csstesting, 'qstyles.css')}"/> 


  <style type="text/CSS">
   @page {
 /* Landscape orientation */
 size:landscape;

 /* Put page numbers in the top right corner of each
    page in the pdf document. */
 @bottom-right {
 content: "Page " counter(page) " of " counter(pages);
 }
 
 }
  </style>
  



 <apex:outputPanel layout="block" styleClass="standardBackground"/>
 <apex:outputText style="background-color:#0000FF"><span>Hello</span></apex:outputText>

</apex:page>
I have a picklist field that has a list of the Queue groups as values. When the case initiator creates a case, they must either assign it to one of the groups in the Queue or keep it. If they assign to a Queue, the owner field must be updated with this new value and an e-mail must be sent to the new owners.

When I deploy to sandbox, which is successful, I get this error message from the APex editor in the sandbox


Error: Compile Error: Variable does not exist: Trigger at line 5 column 18



trigger UpdateCaseOwner on Case (before update) {
    //select Id, Name from Group where Name = 'QA' and Type = 'Queue'
    
    
    for(Case c : Trigger.new()){
        
        List<Group> qid = [select Id from Group where Name = : c.CaseAssignedOwner__c and Type = 'Queue'];
      for(Group g : qid){
            c.OwnerId = g.id;
        }
        
       
    }
      
}
I have created a VF page in Force/Eclipse using the case standardController. when I try to save to server I get the following error messages:
Average test coverage across all Apex Classes and Triggers is 59%, at least 75% test coverage is required.   
System.AssertException: Assertion Failed    

Since I using the standard Case controller, how do it add test coverage to the VF page?
I know this question has been asked before. The question was never satisfactorily answered. 

I have changed the configuration of the Case Owner field in the Case layout to read-only, but the "change" is still active.

Is there a way to override this behaviour to remove this link, or by making this Case Owner really read-only?

or  as workaround I have created a new formula field : Owner:User.FirstName + " " +  Owner:User.LastName. However this only works (shows the owner) after the case is saved. Is there a way to make the Owner apear when the Case is created just like the real Owner field?

maybe have two layouts 1) one with the owner field when the case is created, 2) in edit mode, the case owner is replaced with my custom field.

or, programmically swich fields with a trigger when the case is saved.
Hi

I need to change the ownership of several hundred Opportunities. The following appears to work (no errors) however when I run a query, the test opportunity assigned to this person is still assigned to the original owner. It's as is the record is not getting updated. I have tried the Mass Reassign Opportunities with the same result. The records remain with original owner.

Where is the problem. Btw I am system administrator

List<Opportunity> ops= new List<Opportunity>([select Owner.Name from Opportunity where Owner.Id='005m0000000bLBhAAM']);


if (!ops.isEmpty()){
for(Opportunity o: ops){
     o.Owner.Id='005600000017YNqAAM';
        o.Owner.FirstName = 'Kevin';
        o.Owner.LastName = 'Languedoc';
      System.debug(ops); 
}
update ops;
}

I wrote a class to send email from Force.com ide. When I try to reference it in a trigger I get an invalid type error. Do I have to create a package or use an import statement?

 

this is the trigger....

 

trigger SendAccountMasterUpdates on Account (after insert, after update) {

 

if(Trigger.isInsert)

{

for(Account a : Trigger.new)

{

if(a.Transaction_Account__c == true)

{

SendAccountUpdateMessage mail = new SendAccountUpdateMessage();

}

}

 

}else

{

 

 

}

 

}

 

this is the apex class....

 

 

public with sharing class SendAccountUpdateMessage {

 

public void SendAccountInformation()

{

     .....

}

 

}

I need to setup a worflow rule based on a checkbox. When a certain checkbox is selected, the workflow rule should trigger an outbound  message. I am not sure how to configure this in the worflow rule section ( fieldname equals ?? )  
I need to setup a worflow rule based on a checkbox. When a certain checkbox is selected, the workflow rule should trigger an outbound  message. I am not sure configure this in the worflow rule section ( fieldname equals ?? )

I have an asp.net page that contains a report with from an external database. The asp.net page has to be embedded into the VF page so the users can remain in the same page. How can I pass the current sf session id and sf server url require to authenticate to the asp.net page because the asp.net page needs account information form salesforce.com.

 

thx

 

kevin

What apex element do I use to create the VF Apex popup calendar that is used in VisualForce pages?
Hi
 
Basically I have a flex application embedded in a visualforce page and I need to pass the session id and url like in a scontrol
i.e.:
 <param name="flashvars" value="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_90}" />
However when I try to save, I am getting errors that it is trying not finding API and wants to create a method in my controller class.
 
How can I get and pass the sessionid and url my my flex application from the VisualForce page.
 
Do I need to access it through a scontrol. If so how do I call a scontrol object in my visualforce or apex class?
 
 
 
code:
================================
 
<apex:page Controller="AccountInformationControl" tabstyle="Account">
 
    <script src="/soap/ajax/11.1/connection.js"></script>
    <script>
       function getAccountNo(){
          var accountNo = "{!AccountNumber}";
          return accountNo;
      }
     
      function getAccountName(){
         
        var accountName = "{!AccountName}";
          return accountName ;
      }
     
      function getOtherAccounts(){
         
     
      }
     
      function getSessionId(){
     
     
      }
     
      function getUrl(){
     
      }
  </script>
 
  <h1>DRAXIMAGE Sales Information</h1><br/>
             
             <apex:pageblock >
                 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                  id="SFQueryBuilder" width="100%" height="303"
                  codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                  <param name="movie" value="{!$Resource.SFQueryBuilder}" />
                 <param name="flashvars" value="session_id={!API.Session_ID}&server_url={!API.Partner_Server_URL_90}" />
                  <param name="quality" value="high" />
                  <param name="bgcolor" value="#869ca7" />
                  <param name="allowScriptAccess" value="sameDomain" />
                  <embed src="{!$Resource.SFQueryBuilder}" quality="high" bgcolor="#869ca7"
                    width="100%" height="421" name="SFQueryBuilder" align="middle"
                    play="true"
                    loop="false"
                    quality="high"
                    allowScriptAccess="sameDomain"
                    type="application/x-shockwave-flash"
                    pluginspage="http://www.adobe.com/go/getflashplayer">
                  </embed>
                </object>
           </apex:pageblock>
      <br/>
      </apex:page>
https://login.salesforce.com/17181/logo180.png
Failed to load resource: the server responded with a status of 404 (Not Found)

When I load a VF page of a open case, in the Javascript console, the first line of the output has this error. The instructions at the url says to contact support to fix the issue because the resource no longer exists.
I am trying to run a test but I keep getting the same error that the Address field is empty or missing. When I add a !Test,isRunning I get the following error msg. But the actual class works beautifully in dev. I am trying to get my test coverage up and apply the proper unit test. The actual class is below.

This is the test class

Error message:

 You cannot call addFields when the data is being passed into the controller by the caller.

OR:

13:33:29:311 FATAL_ERROR System.EmailException: SendEmail failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Missing target address (target, to, cc, bcc): []

when I add the following code
 
if(!Test.isRunningTest()){
             sc.addFields(new List<String>{'CaseAssignedOwner__c'});
        }

@isTest
public class testCaseForm1747SendMail {
    static testMethod void testSend(){
       
        Case testCase = new Case();
        testCase.Subject = 'unittest';
        testCase.Description = 'unit test description';
        testCase.CaseAssignedOwner__c = 'klanguedoc@jdi.jubl.com';
        testCase.Case_Category__c = 'Product Enquiry';
        insert testCase;
            
        ApexPages.StandardController sc = new ApexPages.StandardController(testCase);
        // test constructor;
        // testCaseForm1747SendMail

        
       
    
        CaseForm1747SendMail Send1747 = new CaseForm1747SendMail(sc);
        sc.addFields(new List<String>{'CaseAssignedOwner__c'});
       
        send1747.send();
        
        
    }
}

Actual class : works fine
 
public class CaseForm1747SendMail {
    private final Case c;
    public CaseForm1747SendMail(ApexPages.StandardController stdCrlr){
   		if (!Test.isRunningTest()) { 
            stdCrlr.addFields(new List<String>{'CaseAssignedOwner__c'});

        }           
        this.c = (Case)stdCrlr.getRecord();
       
        
    }
    public Case getCase(){
        return c;
    }
   
     public PageReference send() {
        // Define the email
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 

        // Reference the attachment page and pass in the case ID
        PageReference pdf =  Page.SendQA1747asPDF;
        pdf.getParameters().put('id',(String)c.id); 
        pdf.setRedirect(true);

        // Take the PDF content
        //Blob b = pdf.getContent();
         Blob b = Test.isRunningTest() ? Blob.valueOf('UNIT.TEST') : pdf.getContent();

        // Create the email attachment
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
        efa.setFileName(c.CaseNumber + '.pdf');
        efa.setBody(b);
        String[] toAddresses = new List<String>();
        Case_Owner__c[] assignedOwner = new List<Case_Owner__c>();

		System.debug(c.CaseAssignedOwner__c);
       assignedOwner =  [select  MemberEmail__c from Case_Owner__c where Queues__c = : c.CaseAssignedOwner__c ];
         for(Case_Owner__c em : assignedOwner){
            toAddresses.add(String.valueOf(em.MemberEmail__c));
         }
       System.debug(toAddresses);
       
        email.setSubject( c.Subject );
             
        email.setToAddresses( toAddresses );
        email.setPlainTextBody( c.Description );

        email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});

        // Sends the email
        Messaging.SendEmailResult [] r = 
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   
        
        PageReference casePage = new ApexPages.StandardController(c).view();
        casePage.setRedirect(true);
        
        List<Task> tasks = new List<Task>();
        tasks.add(new Task(
    ActivityDate = Date.today(),
    Subject='Envoyé formulaire 1747 pour le Case ' + c.CaseNumber,
    WhatId = c.Id,
    OwnerId = UserInfo.getUserId(),
    Status='Complété - Completed'));

insert tasks;
        return null;
    }
    
}

 
I need to test the communication between javascript in a VF page that is rendered from a button on a open case document and an Apex webservice that is supposed to send an e-mail. However I get the impression that the web service is never called. So I created a small dummy webservice, called WSReturn to receive a name and return a string. I am trying to dtermine if the problem is in the javascript code or the Apex code.

Browser: Chrome, Version 42.0.2311.90 (64-bit) on a Mac
The javascript function sayHelloService is called on the window.onload event. However I am getting this error message:

Refused to set unsafe header "User-Agent"
send @ connection.js:593
sforce.SoapTransport.send @ connection.js:1012
sforce.Connection._invoke @ connection.js:1727
sforce.Apex.execute @ apex.js:60
sayHelloService @ Form1747web?scontrolCaching=1&id=50055000000fkiR&isdtp=vw&nonce=dcb74e9d3d4fd43461bc263b172a1a02c72…:41

Javascript code:
function sayHelloService(){
                  var hello = sforce.apex.execute("WSReturn", "Hello", {name:'Kevin'}); 
                  sforce.debug.log(hello);
               }



Apex Code:
global class WSReturn {
    
    webservice static String Hello(String name){
        String sayHello;
        
        sayHello = 'Hi ' + name;
        System.debug('sayHello');
        
        return sayHello;
        
        
    }

}

 
https://login.salesforce.com/17181/logo180.png
Failed to load resource: the server responded with a status of 404 (Not Found)

When I load a VF page of a open case, in the Javascript console, the first line of the output has this error. The instructions at the url says to contact support to fix the issue because the resource no longer exists.
I am trying to apply CSS styling rules to a Visualforce page. My ultimate goal is to generate a PDF from the page using the renderAs="pdf" (which is not included here because I am trying to isolate the problem).

I have tried creating an external stylesheet using the the various tutorials on developer.force.com pages without any success. These stylesheets were added to the SFDC via static resources as you can see from the code below. However the styling is not rendered.

I also tried apply inline styling to test and again this is not rendered.

I am testing in the Sandbox PRO in my org using API 33. I tried other API versions but got the same results.

Can anyone provide some clues on how to fix the issue

<apex:page showHeader="false" applyHtmlTag="false">
 <apex:stylesheet value="{!URLFOR($Resource.csstesting, 'qstyles.css')}"/> 


  <style type="text/CSS">
   @page {
 /* Landscape orientation */
 size:landscape;

 /* Put page numbers in the top right corner of each
    page in the pdf document. */
 @bottom-right {
 content: "Page " counter(page) " of " counter(pages);
 }
 
 }
  </style>
  



 <apex:outputPanel layout="block" styleClass="standardBackground"/>
 <apex:outputText style="background-color:#0000FF"><span>Hello</span></apex:outputText>

</apex:page>
I have a picklist field that has a list of the Queue groups as values. When the case initiator creates a case, they must either assign it to one of the groups in the Queue or keep it. If they assign to a Queue, the owner field must be updated with this new value and an e-mail must be sent to the new owners.

When I deploy to sandbox, which is successful, I get this error message from the APex editor in the sandbox


Error: Compile Error: Variable does not exist: Trigger at line 5 column 18



trigger UpdateCaseOwner on Case (before update) {
    //select Id, Name from Group where Name = 'QA' and Type = 'Queue'
    
    
    for(Case c : Trigger.new()){
        
        List<Group> qid = [select Id from Group where Name = : c.CaseAssignedOwner__c and Type = 'Queue'];
      for(Group g : qid){
            c.OwnerId = g.id;
        }
        
       
    }
      
}
I know this question has been asked before. The question was never satisfactorily answered. 

I have changed the configuration of the Case Owner field in the Case layout to read-only, but the "change" is still active.

Is there a way to override this behaviour to remove this link, or by making this Case Owner really read-only?

or  as workaround I have created a new formula field : Owner:User.FirstName + " " +  Owner:User.LastName. However this only works (shows the owner) after the case is saved. Is there a way to make the Owner apear when the Case is created just like the real Owner field?

maybe have two layouts 1) one with the owner field when the case is created, 2) in edit mode, the case owner is replaced with my custom field.

or, programmically swich fields with a trigger when the case is saved.
Hi

I need to change the ownership of several hundred Opportunities. The following appears to work (no errors) however when I run a query, the test opportunity assigned to this person is still assigned to the original owner. It's as is the record is not getting updated. I have tried the Mass Reassign Opportunities with the same result. The records remain with original owner.

Where is the problem. Btw I am system administrator

List<Opportunity> ops= new List<Opportunity>([select Owner.Name from Opportunity where Owner.Id='005m0000000bLBhAAM']);


if (!ops.isEmpty()){
for(Opportunity o: ops){
     o.Owner.Id='005600000017YNqAAM';
        o.Owner.FirstName = 'Kevin';
        o.Owner.LastName = 'Languedoc';
      System.debug(ops); 
}
update ops;
}

Hi - 

 

I found this really cool gantt chart, but for some reason I'm having problem embedding it into my Visual Force page. The link of the gantt chart is the following:

 

http://dhtmlx.com/docs/products/dhtmlxGantt/index.shtml

 

I was wondering if anyone can help me figure out what's wrong with the below code? I'm not really getting any error message but the inspect element has "Uncaught TypeError: Cannot call method 'addEventListener' of null". 

 

 

<apex:page >

    <apex:stylesheet value="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxgantt.css')}"/>
    <script type="text/javascript" language="JavaScript" src="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxcommon.js')}"></script>
    <script type="text/javascript" language="JavaScript" src="{!URLFOR($Resource.Timeline, 'codebase/dhtmlxgantt.js')}"></script>


    <head>


    <script language="JavaScript" type="text/javascript">
        function createChartControl(htmlDiv1)
        {
            //project 1
            var project1 = new GanttProjectInfo(1, "Applet 11redesign", new Date(2010, 5, 11));
    
            var parentTask1 = new GanttTaskInfo(1, "Old code review", new Date(2010, 5, 11), 208, 50, "");
            parentTask1.addChildTask(new GanttTaskInfo(2, "Convert to J#", new Date(2010, 5, 11), 100, 40, ""));
            parentTask1.addChildTask(new GanttTaskInfo(13, "Add new functions", new Date(2010, 5, 12), 80, 90, ""));
    
            var parentTask2 = new GanttTaskInfo(3, "Hosted Control", new Date(2010, 6, 7), 190, 80, "1");
            var parentTask5 = new GanttTaskInfo(5, "J# interfaces", new Date(2010, 6, 14), 60, 70, "6");
            var parentTask123 = new GanttTaskInfo(123, "use GUIDs", new Date(2010, 6, 14), 60, 70, "");
            parentTask5.addChildTask(parentTask123);
            parentTask2.addChildTask(parentTask5);
            parentTask2.addChildTask(new GanttTaskInfo(6, "Task D", new Date(2010, 6, 10), 30, 80, "14"));
    
            var parentTask4 = new GanttTaskInfo(7, "Unit testing", new Date(2010, 6, 15), 118, 80, "6");
            var parentTask8 = new GanttTaskInfo(8, "core (com)", new Date(2010, 6, 15), 100, 10, "");
            parentTask8.addChildTask(new GanttTaskInfo(55555, "validate uids", new Date(2010, 6, 20), 60, 10, ""));
            parentTask4.addChildTask(parentTask8);
            parentTask4.addChildTask(new GanttTaskInfo(9, "Stress test", new Date(2010, 6, 15), 80, 50, ""));
            parentTask4.addChildTask(new GanttTaskInfo(10, "User interfaces", new Date(2010, 6, 16), 80, 10, ""));
            parentTask2.addChildTask(parentTask4);
    
            parentTask2.addChildTask(new GanttTaskInfo(11, "Testing, QA", new Date(2010, 6, 21), 60, 100, "6"));
            parentTask2.addChildTask(new GanttTaskInfo(12, "Task B (Jim)", new Date(2010, 6, 8), 110, 1, "14"));
            parentTask2.addChildTask(new GanttTaskInfo(14, "Task A", new Date(2010, 6, 7), 8, 10, ""));
            parentTask2.addChildTask(new GanttTaskInfo(15, "Task C", new Date(2010, 6, 9), 110, 90, "14"));
    
            project1.addTask(parentTask1);
            project1.addTask(parentTask2);
    
            //project 2
            var project2 = new GanttProjectInfo(2, "Web Design", new Date(2010, 5, 17));
    
            var parentTask22 = new GanttTaskInfo(62, "Fill HTML pages", new Date(2010, 5, 17), 157, 50, "");
            parentTask22.addChildTask(new GanttTaskInfo(63, "Cut images", new Date(2010, 5, 22), 78, 40, ""));
            parentTask22.addChildTask(new GanttTaskInfo(64, "Manage CSS", null, 90, 90, ""));
            project2.addTask(parentTask22);
    
            var parentTask70 = new GanttTaskInfo(70, "PHP coding", new Date(2010, 5, 18), 120, 10, "");
            parentTask70.addChildTask(new GanttTaskInfo(71, "Purchase D control", new Date(2010, 5, 18), 50, 0, ""));
            project2.addTask(parentTask70);
    
            var ganttChartControl = new GanttChart();
            ganttChartControl.setImagePath("{!URLFOR($Resource.Timeline, 'codebase/imgs/')}");
            
            ganttChartControl.setEditable(true);
            
            ganttChartControl.addProject(project1);
            
            ganttChartControl.create(htmlDiv1);
        }
    </script>
    
    <style>
        body {font-size:12px}
        .{font-family:arial;font-size:12px}
        h1 {cursor:hand;font-size:16px;margin-left:10px;line-height:10px}
        xmp {color:green;font-size:12px;margin:0px;font-family:courier;background-color:#e6e6fa;padding:2px}
        .hdr{
            background-color:lightgrey;
            margin-bottom:10px;
            padding-left:10px;
        }
    </style>

    </head>

    <body onload="createChartControl('GanttDiv');">
        <div style="width:950px;height:620px;position:absolute;" id="GanttDiv"></div>
    </body>



</apex:page>

 

I wrote a class to send email from Force.com ide. When I try to reference it in a trigger I get an invalid type error. Do I have to create a package or use an import statement?

 

this is the trigger....

 

trigger SendAccountMasterUpdates on Account (after insert, after update) {

 

if(Trigger.isInsert)

{

for(Account a : Trigger.new)

{

if(a.Transaction_Account__c == true)

{

SendAccountUpdateMessage mail = new SendAccountUpdateMessage();

}

}

 

}else

{

 

 

}

 

}

 

this is the apex class....

 

 

public with sharing class SendAccountUpdateMessage {

 

public void SendAccountInformation()

{

     .....

}

 

}