• AmolIkhe
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hello All,

 

i am fatching problem in test coverage.I want to integrate this class in Package. Please send me test class for following code.

 

public with sharing class SignUpController {
     public String SignUpController{ get; set; }
     public String ContactId {get; set ; }
  
    public String firstName {get; set ; }
   
    public String lastName {get; set ; }
   
    public String company {get; set ; }
      
    public String phone {get; set ; }
   
    public String emailId {get; set ; }
     
    public String password {get; set ; }
   
    public String confirmPassword {get; set;}
    
    public String TermsnCondtions {get; set;}
    
    public PageReference GetResult()
    {    
      Account a = new Account();
      Contact c = new Contact();    
      if(company == '')
      {
        a.Name = firstName + ' ' + lastName;
      }
      else
      {
        a.Name = company;
      }
    List<PartnerNetworkConnection> connMap = new List<PartnerNetworkConnection> (
    [Select Id, ConnectionStatus, ConnectionName From PartnerNetworkConnection where ConnectionStatus = 'Accepted']);
     for(PartnerNetworkConnection network : connMap)
        {
            String cid= network.Id;        
            String status = network.ConnectionStatus;          
            String connName = network.ConnectionName;
            PartnerNetworkRecordConnection newrecord = new PartnerNetworkRecordConnection();
            newrecord.ConnectionId = cid;
            //newrecord.LocalRecordId = uId;
            newrecord.RelatedRecords = 'Contact,Opportunity';
            newrecord.SendClosedTasks = true;
            newrecord.SendOpenTasks = true;
            newrecord.SendEmails = true;
            insert a;
            List<PartnerNetworkRecordConnection> connMap2 = new List<PartnerNetworkRecordConnection> (
            [Select PartnerRecordId,LocalRecordId From PartnerNetworkRecordConnection where LocalRecordId =: a.Id]);           
           
            //c.AccountId = a.Id;
            c.FirstName = firstName;
            c.LastName = lastName;
            c.Email = emailId;
            c.Phone = phone;
            c.User_Accepted_Terms_Date__c = System.Datetime.now();
            c.Password__c = password;
            c.Description = connMap2[0].LocalRecordId;
            insert c;
            ContactId = c.Id;
        }           
        //Set Redirct Url
        PageReference pageRef = new PageReference('/apex/UserSettings');
        //Set Query string
        pageRef.getParameters().put('cid',ContactId);               
        pageRef.setRedirect(true);
        return  pageRef;
    } 

 

 

 Thanks in advance.

 

Thanks

  Amol

Hello Everybody,

 

I have created one custom button and i want to show that button on contact details page when i ll deploy package on another account.But after deployment of package i am unable to show that button on contact details page for same i have to add custom button on contact details page from edit layout.

 

Thanks

Amol 

Hi

 

can anybody have an idea how can we can consume an internal salesforce webservice(Partner WSDL) in apex code?

 

I want to insert a record from one salesforce organization to another organization.  I have created a form which needs to insert a contact record to another organization contact object.

 

 

How can we insert the record to different Organization using webservice?

 

 

Thanks