• Doomsday
  • NEWBIE
  • 110 Points
  • Member since 2012

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 21
    Replies

Does anyone have a solution for this eclipse/IDE issue when creating a new Force.com project from sandbox or production instance (below)?

Taking default of "Apex & Visualforce" metadata components for download. Click Finish and receive dialog box entitled "Fetch Error".

Environment:

Eclipse SDK v.3.7.2 

Java Standard v7 update 4

Java Runtime 1.7 & 1.6 enabled.

Force.com IDE 24.0.0

 

FAQ states eclipse 3.6 & 3.5 are supported - although I have been successfully running with eclipse 3.7.1 up until this past weekend.

From the Force.com IDE log file:


DEBUG [2012-05-23 09:24:08,551] (PackageManifestFactory.java:getPackageManifest:110) - Found existing existing package manifest.
DEBUG [2012-05-23 09:24:08,552] (PackageManifestFactory.java:parsePackageManifest:946) - Parsing and creating package manifest instance from 'D:\My Documents\Workspaces\SF test\src\package.xml'
ERROR [2012-05-23 09:24:08,559] (PackageManifestFactory.java:getPackageManifest:115) - Unable to create package manifest
java.lang.ClassCastException: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
at com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.SingleElementLeafProperty.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 

thanks, -doug

Hi,

this is my controller and my apex page:

<apex:page standardController="opportunity" extensions="myControllerExtension">
    <apex:form >
        <apex:pageBlock >  
           <apex:pageBlockSection title="Information Avenant">

                    //to display the name of the master opportunity and can edit
                  <apex:inputField value="{!opportunity.name}"/> <p/>
                  <apex:outputField value="{!opportunity.N_police_d_origine__c}"/> <p/>
                  <apex:inputField value="{!opportunity.Date_d_avenant__c}"/> <p/>
                  <apex:inputField value="{!opportunity.Statut_Police__c}"/> <p/>   
              </apex:pageBlockSection>   
             <apex:pageBlockButtons >
                   <apex:commandButton value="Enregistrer" action="{!enregistrer}"/>
                   <apex:commandButton value="cancel" action="{!cancel}"/>
             </apex:pageBlockButtons>
                           </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

 

public class myControllerExtension {


private String name;


   public Opportunity Opp {get;set;}
   public Opportunity OppAcc {get;set;}
   

   
 
 
   ApexPages.StandardController controller;   
   public myControllerExtension(ApexPages.StandardController c)
   
   {
          Opp = (Opportunity)c.getRecord();
   }
     

      
 
 
 
 
        public PageReference Avenant()
      {
        return Page.Avenant;
      }
   
   
     public PageReference cancel()
     {
            PageReference opportunityPage = new ApexPages.StandardController(opp).view();
            opportunityPage.setRedirect(true);
            return opportunityPage;
     }
    
    
   public PageReference enregistrer() {

//add a news code to crate a new opportunity

}

 

 

how to retrieve the data entered in the apex page and create a new opportunity?

 

thanks.

 

 

I have no problem on displaing an image on a visualforce page from a controller, but when i try to do the same thing on a email (A mass email in my case) it seems don't work (the document is externally available)

 

Here is my code:

 

public string getDocumentLogoUrl()

{

List<Document> lstDocument = [Select Id,Name,LastModifiedById from Document where Name = 'Header' limit 1];
string strOrgId = UserInfo.getOrganizationId();
string strDocUrl = 'https://'+ApexPages.currentPage().getHeaders().get('Host')+ '/servlet/servlet.ImageServer?id='+lstDocument[0].Id+'&oid=' + strOrgId;

return strDocUrl;

}

 

 

 

public static void sendMail(string email, string first_name, string last_name) {


Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {email};
mail.setToAddresses(toAddresses);

mail.setSubject('xxx');

mail.setHtmlBody('<img url="{!DocumentLogoUrl}" styleClass="photo"></apex:img><br/><br/>Salve '+First_Name+' '+last_name+');



Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}

(Edited after Doomsday reply)

 

Like always, thanks in advance

 

Hi

How To intialize the Person account in a  test  case ......

 

Thanks in advances

  • May 11, 2012
  • Like
  • 0

hi everyone 

 

i have one class below which is used as a component,but i unable to deploy due to code coverage.

 

Apex Class :

 

public with sharing class ItineraryBuilderController {
public List<Test_Flight_Request__c> listFR;
public Id opportunityID;
public string result;
public Id getopportunityID(){ return opportunityID; }

public void setopportunityID(Id s){
opportunityID = s;
ItineraryBuilderController();
}
public void ItineraryBuilderController() {
listFR = [select Name From Test_Flight_Request__c where Opportunity__c = :opportunityID
and Customer_Approved__c = true
order by Name asc limit 1 ];


}

public string getIB()
{

Http h = new Http();
HttpRequest req = new HttpRequest();
req.setEndpoint('http://testsite/GetCustomerView?opportunityId='+listFR[0].Opportunity__c+'&flightRequestID='+listFR[0].Id);
req.setMethod('GET');

HttpResponse res = h.send(req);
result = res.getBody();

return result;

}


}

 

Test class

 

@isTest
private class ItineraryBuilderControllerTestCase {

static testMethod void ItineraryBuilderController_TestMetho() {
Opportunity opp = new Opportunity();
opp.Name = 'Test Opp';
opp.StageName = 'Ticketing';
opp.p1_First_Name__c ='A';
opp.p1_Last_Name__c ='D';
opp.p1_Gender__c = 'S';
opp.p1_First_Name__c ='S';
opp.p1_Last_Name__c ='A';
opp.p1_Gender__c = 'D';
opp.DOB_Main_Passenger__c = System.now().date();
opp.Number_of_Passengers__c = 4;
opp.CloseDate = System.now().date();
opp.Departure_Date__c = System.now().date();
opp.Origin_City__c = 'DEL';
opp.Destination_City__c= 'MUI';
opp.Return_Date__c = System.now().date();
insert opp;

Test_Flight_Request__c fr = new Test_Flight_Request__c();
fr.Budget__c = '23';
fr.Publish_Fare__c = '35';
fr.Opportunity__c = opp.Id;
fr.From__c = opp.Origin_City__c;
fr.To__c = opp.Destination_City__c;
fr.Outbound_del__c = opp.Departure_Date__c;
fr.Pax_del__c = opp.Number_of_Passengers__c;
fr.Region_del__c = opp.Destination_Zone__c;
fr.Inbound_del__c = opp.Return_Date__c;
fr.Outbound_Flexibility__c = opp.Flexibility_From__c;
fr.Inbound_Flexibility__c = opp.Flexibility_To__c;
fr.Email_To__c ='anil@swiftsetup.com';
fr.Email_Content__c= 'Test';
fr.Subject__c ='subject test';

insert fr;


}
}

 

please let me know where i am going wrong.

 

thanks in advance


 

 

Does anyone have a solution for this eclipse/IDE issue when creating a new Force.com project from sandbox or production instance (below)?

Taking default of "Apex & Visualforce" metadata components for download. Click Finish and receive dialog box entitled "Fetch Error".

Environment:

Eclipse SDK v.3.7.2 

Java Standard v7 update 4

Java Runtime 1.7 & 1.6 enabled.

Force.com IDE 24.0.0

 

FAQ states eclipse 3.6 & 3.5 are supported - although I have been successfully running with eclipse 3.7.1 up until this past weekend.

From the Force.com IDE log file:


DEBUG [2012-05-23 09:24:08,551] (PackageManifestFactory.java:getPackageManifest:110) - Found existing existing package manifest.
DEBUG [2012-05-23 09:24:08,552] (PackageManifestFactory.java:parsePackageManifest:946) - Parsing and creating package manifest instance from 'D:\My Documents\Workspaces\SF test\src\package.xml'
ERROR [2012-05-23 09:24:08,559] (PackageManifestFactory.java:getPackageManifest:115) - Unable to create package manifest
java.lang.ClassCastException: com.salesforce.ide.api.metadata.types.Metadata$JaxbAccessorF_fullName cannot be cast to com.sun.xml.internal.bind.v2.runtime.reflect.Accessor
at com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.property.SingleElementLeafProperty.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

 

thanks, -doug

hi,

please find the below lines of code

 

sObject s=new Account[select id,name from Account where name like 'test%'];

ID i=s.id;//valid

String name=s.name//invalid

 

please correct me if i am wrong, why the second statement is invalid and first statement is valid because as far as i knows that sObject holds the state and behaviour of all the concrete objects here sObject is generic object and Account object is concrete object.

please provide the detailed solution that why we can not access the id field using sObject reference i.e 's'

 

Thanks in advance

  • May 23, 2012
  • Like
  • 0

Hi,

this is my controller and my apex page:

<apex:page standardController="opportunity" extensions="myControllerExtension">
    <apex:form >
        <apex:pageBlock >  
           <apex:pageBlockSection title="Information Avenant">

                    //to display the name of the master opportunity and can edit
                  <apex:inputField value="{!opportunity.name}"/> <p/>
                  <apex:outputField value="{!opportunity.N_police_d_origine__c}"/> <p/>
                  <apex:inputField value="{!opportunity.Date_d_avenant__c}"/> <p/>
                  <apex:inputField value="{!opportunity.Statut_Police__c}"/> <p/>   
              </apex:pageBlockSection>   
             <apex:pageBlockButtons >
                   <apex:commandButton value="Enregistrer" action="{!enregistrer}"/>
                   <apex:commandButton value="cancel" action="{!cancel}"/>
             </apex:pageBlockButtons>
                           </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

 

public class myControllerExtension {


private String name;


   public Opportunity Opp {get;set;}
   public Opportunity OppAcc {get;set;}
   

   
 
 
   ApexPages.StandardController controller;   
   public myControllerExtension(ApexPages.StandardController c)
   
   {
          Opp = (Opportunity)c.getRecord();
   }
     

      
 
 
 
 
        public PageReference Avenant()
      {
        return Page.Avenant;
      }
   
   
     public PageReference cancel()
     {
            PageReference opportunityPage = new ApexPages.StandardController(opp).view();
            opportunityPage.setRedirect(true);
            return opportunityPage;
     }
    
    
   public PageReference enregistrer() {

//add a news code to crate a new opportunity

}

 

 

how to retrieve the data entered in the apex page and create a new opportunity?

 

thanks.

 

 

Hello,

 

I'm trying to access the $User.email global variable from within an Apex class. Is this possible? I just need to get the running user's email address.

 

A quick response will be very helpful,

Thanks

I want to get the parent ID in my child custom controller. How can I do this, please ?

I have no problem on displaing an image on a visualforce page from a controller, but when i try to do the same thing on a email (A mass email in my case) it seems don't work (the document is externally available)

 

Here is my code:

 

public string getDocumentLogoUrl()

{

List<Document> lstDocument = [Select Id,Name,LastModifiedById from Document where Name = 'Header' limit 1];
string strOrgId = UserInfo.getOrganizationId();
string strDocUrl = 'https://'+ApexPages.currentPage().getHeaders().get('Host')+ '/servlet/servlet.ImageServer?id='+lstDocument[0].Id+'&oid=' + strOrgId;

return strDocUrl;

}

 

 

 

public static void sendMail(string email, string first_name, string last_name) {


Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {email};
mail.setToAddresses(toAddresses);

mail.setSubject('xxx');

mail.setHtmlBody('<img url="{!DocumentLogoUrl}" styleClass="photo"></apex:img><br/><br/>Salve '+First_Name+' '+last_name+');



Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}

(Edited after Doomsday reply)

 

Like always, thanks in advance

 

Hi

How To intialize the Person account in a  test  case ......

 

Thanks in advances

  • May 11, 2012
  • Like
  • 0