• Monikaallada
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 15
    Replies

this is my page 

here in which i will enter the values in the required fields in VFpage and insert the account with the help of apex class.

<Apex:Form>

<apex:pageBlock Title="Add a new account" rendered="{!showresult}">
<apex:outputLabel for="a">AccountName: </apex:outputLabel>
<apex:inputField value="{!details.name}" id="a"/>
BillingCity: <apex:inputField value="{!details.billingcity}"/>
AccountNumber: <apex:inputField value="{!details.Accountnumber}"/>
<apex:commandButton value="save" action="{!ad}"/>
</apex:pageBlock>

</apex:form>

 

This is my class 

 

Public class Accountdetails{

boolean showresult=true;

public Account getdetails() // after clicking the new button we get fields to create a new account those details set here
{

return b;


}
public pageReference ad()// after clicking the save button the insertion takes place.
{
insert b;
showresult = false;// the pageblock of the create account will be disable.
return null;
}

}

 

now please suggest me how to write test method for this.

I am not getting how to retrive the values from VF to test class.

 

Please any one can help me.

This is my test class

@isTest
public class testAccountdetails
{
static testMethod void testAccountdetails()
{

Accountdetails ad = new Accountdetails();

ad.Aname='GenePoint';
List<contact> cn = ad.getcodetails();
if(!cn.isEmpty()){
for( contact c : cn){
System.assertEquals('Edna Fra',c.LastName);// here test must fail but no error.
}
}

 

Apex class:

 

public class Accountdetails
{

public String Aname;

public List<contact> getcodetails()
{

cc =[select name ,Email from Contact where Account.name=:Aname ];
return cc;
}
}

 

According to this i should get a test failure because in the system.assertEqual i gave a wrong contact name.

Instead of that test is success, 

 

Can any one please tell where the mistake is.

HI...

 

this my testclass.

 

@isTest
private class testloadinginsamepage
{
   static testMethod void Mypage_test()
   {

        Accountdetails  ad = new Accountdetails();

        String Aname ='GenePoint';
        System.assertEquals('GenePoint',Aname); // here success
        List<contact> cn = ad.getcodetails();
        List<Contact> cn1 = [select LastName from contact where Account.name = 'GenePoint' limit 1];
        System.assertEquals('Edna Fra',cn1[0].LastName);
       }

}

 

This is my apex class.

 

public class Accountdetails 
{  
    public String Aname {get; set;}
      public List<contact> getcodetails()
    {
        
          cc =[select name ,Email from Contact where Account.name=:Aname ];
         return cc;
    }

}

 

Can any one please tell me where i am doing the mistake. 

 

 

Hi

 

I am new to salesforce

 

Can any one help me out why this error while installation force IDE.

 

 

This is the Error

 JVM terminated Exitcode=1

.

.

..

.

.

.

..

.

.

.

.

Djava.classpath=c\Programfiles\salesforce.com\Force.comIDE\.../common/plugins/org.eclipse....

 

Thanks in advance.

 

 

 

 

 

 

Can any one help me out

public class Ticket
{
   
    string[] StartP =new String[]{};
    string[] EndP = new String[]{};
    public integer b;
    public integer c;
    public integer z{get; set;}
     public integer BR;
    public integer a {get; set;}
    public String BS {get; set;}
    
     
    
   public PageReference submit()
   {
   
       return null;
   }
   public integer getnumber()
   {
       return a;
   }
   public List<selectOption> getitems()
   {
       List<SelectOption> op1 = new List<SelectOption>();
       op1.add(new selectOption('Miyapur','Miyapur'));
       op1.add(new selectOption('Moosapet','Moosapet'));
       return op1;
   }
   public List<selectOption> getitems1()
   {
       List<SelectOption> op2 = new List<SelectOption>();
       op2.add(new selectOption('Bharatnagar','Bharatnagar'));
       op2.add(new selectOption('Moosapet','Moosapet'));
       return op2;
   }
   public String[] getStartP()
   {
       return StartP;
   }
   public void setStartP(String[] StartP)
   {
       this.StartP = StartP;
   }
    public String[] getEndP()
   {
       return EndP;
   }
   public void setEndP(String[] EndP)
   {
       this.EndP = EndP;
   }
    
   public integer i{get; set;}
   public integer w{get; set;}
   public integer x{get; set;}
   public integer v {get; set;}
   public String MSg{get; set;}
   
    public Integer getScode()
      {
   List<Place__c> p = new List<Place__c>();
        p =[Select Distance__c,BusStations__c from Place__c];
        for( List<Place__c> m : p)
        {
           if(m.BusStations__c == EndP )
            {
                
              i = integer.valueof(m.Distance__c  );
                }
             
        }
           for(List<Place__c> z : p)
       {
            if(z.BusStations__c == Startp)
            {
               w = integer.valueof(z.Distance__c);
            }
                    
        }
        try{
             x = (i-w);
               }catch(System.Exception e)
               {
                  System.debug('Exception occured: ' + e);
              
              }
               return x;
    }
    List<Place__c> q =new List<Place__c>();
    public List<Place__c> getEcode()
    {
        q = [select Distance__c,BusStatoonCode__c from Place__c where BusStations__c =:EndP];
        return q;
    }
    Public List<Place__c> getinfo()
    {
        List<Place__c> k = [select Distance__c,BusStatoonCode__c from Place__c where BusStations__c =:StartP];
        return k;
    }
        
}

this is my page 

here in which i will enter the values in the required fields in VFpage and insert the account with the help of apex class.

<Apex:Form>

<apex:pageBlock Title="Add a new account" rendered="{!showresult}">
<apex:outputLabel for="a">AccountName: </apex:outputLabel>
<apex:inputField value="{!details.name}" id="a"/>
BillingCity: <apex:inputField value="{!details.billingcity}"/>
AccountNumber: <apex:inputField value="{!details.Accountnumber}"/>
<apex:commandButton value="save" action="{!ad}"/>
</apex:pageBlock>

</apex:form>

 

This is my class 

 

Public class Accountdetails{

boolean showresult=true;

public Account getdetails() // after clicking the new button we get fields to create a new account those details set here
{

return b;


}
public pageReference ad()// after clicking the save button the insertion takes place.
{
insert b;
showresult = false;// the pageblock of the create account will be disable.
return null;
}

}

 

now please suggest me how to write test method for this.

I am not getting how to retrive the values from VF to test class.

 

Please any one can help me.

This is my test class

@isTest
public class testAccountdetails
{
static testMethod void testAccountdetails()
{

Accountdetails ad = new Accountdetails();

ad.Aname='GenePoint';
List<contact> cn = ad.getcodetails();
if(!cn.isEmpty()){
for( contact c : cn){
System.assertEquals('Edna Fra',c.LastName);// here test must fail but no error.
}
}

 

Apex class:

 

public class Accountdetails
{

public String Aname;

public List<contact> getcodetails()
{

cc =[select name ,Email from Contact where Account.name=:Aname ];
return cc;
}
}

 

According to this i should get a test failure because in the system.assertEqual i gave a wrong contact name.

Instead of that test is success, 

 

Can any one please tell where the mistake is.

HI...

 

this my testclass.

 

@isTest
private class testloadinginsamepage
{
   static testMethod void Mypage_test()
   {

        Accountdetails  ad = new Accountdetails();

        String Aname ='GenePoint';
        System.assertEquals('GenePoint',Aname); // here success
        List<contact> cn = ad.getcodetails();
        List<Contact> cn1 = [select LastName from contact where Account.name = 'GenePoint' limit 1];
        System.assertEquals('Edna Fra',cn1[0].LastName);
       }

}

 

This is my apex class.

 

public class Accountdetails 
{  
    public String Aname {get; set;}
      public List<contact> getcodetails()
    {
        
          cc =[select name ,Email from Contact where Account.name=:Aname ];
         return cc;
    }

}

 

Can any one please tell me where i am doing the mistake. 

 

Hi all,

   I have a picklist .This picklist contains some account id. and some account id(its a text filed).When this value exist in that particular picklist ,that value populated first and remaining values come as usual. Any one can u please help me this.......

 

 

 

 

 

 

 

 

 

 

Thanks in advance.

Can any one help me out

public class Ticket
{
   
    string[] StartP =new String[]{};
    string[] EndP = new String[]{};
    public integer b;
    public integer c;
    public integer z{get; set;}
     public integer BR;
    public integer a {get; set;}
    public String BS {get; set;}
    
     
    
   public PageReference submit()
   {
   
       return null;
   }
   public integer getnumber()
   {
       return a;
   }
   public List<selectOption> getitems()
   {
       List<SelectOption> op1 = new List<SelectOption>();
       op1.add(new selectOption('Miyapur','Miyapur'));
       op1.add(new selectOption('Moosapet','Moosapet'));
       return op1;
   }
   public List<selectOption> getitems1()
   {
       List<SelectOption> op2 = new List<SelectOption>();
       op2.add(new selectOption('Bharatnagar','Bharatnagar'));
       op2.add(new selectOption('Moosapet','Moosapet'));
       return op2;
   }
   public String[] getStartP()
   {
       return StartP;
   }
   public void setStartP(String[] StartP)
   {
       this.StartP = StartP;
   }
    public String[] getEndP()
   {
       return EndP;
   }
   public void setEndP(String[] EndP)
   {
       this.EndP = EndP;
   }
    
   public integer i{get; set;}
   public integer w{get; set;}
   public integer x{get; set;}
   public integer v {get; set;}
   public String MSg{get; set;}
   
    public Integer getScode()
      {
   List<Place__c> p = new List<Place__c>();
        p =[Select Distance__c,BusStations__c from Place__c];
        for( List<Place__c> m : p)
        {
           if(m.BusStations__c == EndP )
            {
                
              i = integer.valueof(m.Distance__c  );
                }
             
        }
           for(List<Place__c> z : p)
       {
            if(z.BusStations__c == Startp)
            {
               w = integer.valueof(z.Distance__c);
            }
                    
        }
        try{
             x = (i-w);
               }catch(System.Exception e)
               {
                  System.debug('Exception occured: ' + e);
              
              }
               return x;
    }
    List<Place__c> q =new List<Place__c>();
    public List<Place__c> getEcode()
    {
        q = [select Distance__c,BusStatoonCode__c from Place__c where BusStations__c =:EndP];
        return q;
    }
    Public List<Place__c> getinfo()
    {
        List<Place__c> k = [select Distance__c,BusStatoonCode__c from Place__c where BusStations__c =:StartP];
        return k;
    }
        
}

i currently want to access mobile number of a user from feeditem i came across the above error ,how can i access it

  suggest me.the code was executed but we share something in chatter that time  the above error is came

 

 

 

 

Thanks@Regards

Bhagi

  • June 26, 2012
  • Like
  • 0

hi,

 

I am facing problem in installing Force.com IDE for Eclipse 3.3.x .

 

As per steps mentioned for  Force.com IDE Installation for Eclipse 3.3.x

I am facing problem at step 3 which is

 

Add the Force.com IDE Remote Site:

1. Launch Eclipse, and then click Help > Software Updates > Find and Install.

2. Select "Search for new features to install" and click "Next".

3. Add the Force.com IDE Remote Site:


Click "New Remote Site". The New Update Site dialog opens.
Set the Name to "Force.com IDE" and the URL to "Link: ", then click OK.
Select “Europa Discovery Site” and "Automatically select mirrors”, then click “Finish”. Eclipse will search the selected sites for the required plugins.
here at "Link:" =  "http://www.adnsandbox.com/tools/ide/install/" link nothing is there except a redirection link to Force.com IDE Installation for Eclipse 3.3.x  is there

thats why Eclipse Update Manager is showing error as follow :

Network connection problems encountered during search.


  Network connection problems encountered during search.
  Unable to access "http://download.eclipse.org/releases/europa".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
  Unable to access "http://www.adnsandbox.com/tools/ide/install/".
    Error parsing site stream. [Premature end of file.]
    Premature end of file.
    Error parsing site stream. [Premature end of file.]
    Premature end of file.


Can anybody help me to get Force.com paltform installed.

Thanking in advance.

 

Rjoshi

  • November 11, 2009
  • Like
  • 0