• Nitesh Agarwal
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 6
    Replies
Dear All,

I have confusion around deployment of my validated Change set on produciton.

Background

The change set contains the existing classes, triggers, Test classes and custom objects, cusotm fileds, already on produciton. I have just changed the contents a bit on sandbox in these apex classes, triggers, and custom field, and have tested all on sandbox, created change set and uploaded it on produciton. then I have validated it there and validaiton is a success.

Confusion I have

Now, when I am about to delpoy to production org, I am thinking about the existing classess, triggers, test classes and custom fields, on the produciton org and is also a part of change set.

So When I will deploy this change set will it delete the existing ones on the production, or wil it overwirte them or will it create a new one. What will happen to the data already there in those exisitng fields.

It will be a great help if somebody can clear this confusion for me, as it is the first time I am with a change set with exisiting Apex classes and test classes, triggers and cusotm fields. Or can help me with some other means I can change the code on those classes in Production org.

Thanks
Nitesh
Dear All,

 Greetings of the day!

 I have created an apex class and a VF page to display some data in XML format. I have developed it in one sandbox and it was working fine on  it and sample data was getting displayed in XML format through VF page, then realised that was not a true copy of production. so I made a true  copy of production on another sandbox, and then created the same apex class and VF page with same code and same naming conventions.

 For my surprise, the VF page is not displaying anything on this sandbox.

 Can anybody suggest, what could be the reason for this. 

 Below are codes

 VF Page
<apex:page Controller="StreamExample" contentType="text/xml" showHeader="true" sidebar="false" cache="false"> </apex:page>

Apex Class Code

public class StreamExample{
public StreamExample()
{
     XmlStreamWriter writer = new XmlStreamWriter();
    
    writer.writeStartDocument('utf-8', '1.0');        
    writer.writeStartElement(null, 'DEXFileUpload', null);
    writer.writeStartElement(null, 'Clients', null);
    
  
   writer.writeEndElement(); //closing tag for Clients
  writer.writeEndElement();//closing tag for Dex
    writer.close();
     
         
}
}
 

Thanks in Advance


Regards
Nitesh
Dear All,

Greetings of the day!

I am facing couple of issues with change set, as I am doing it first time. I tried creating inbound and outbound change set and have included all parts of new development on Sandbox. 

Still when I validate it on Production, it comes up with errors.
Would you be able to guide me out on how to get through it?

Attached below are the images from sandbox and production. 

Outbound Change Set is in Sandbox
Inbound Change Set is in Produciton

User-added image


User-added image

User-added image


Apex Controller class is 


public class customPickListInVFDemoController {
    public String Country { get; set; }
    public String City{ get; set; }
    public String Suburb { get; set; }
    public String ClientSuburb { get; set; }
    public String State { get; set; }
    public String PostCodes { get; set; }
    public String ClientState { get; set; }
    public String ClientPostCodes { get; set; }
    public Address_Details__c address { get; private set; }
    public Client__c client { get; private set; }
    public String AddrId {get; set;}
    public Id clientId;
   // public List<SelectOption> detailOptions{ get; set; }
   // public String details { get; set; }
    public Boolean bRenderDetail {get; set;}

 
//   TODO:  rename getCountriesOptions to getPostcodeOptions
    public List<SelectOption> getPostCodeOptions()
    {
         Set<String> distintList = new Set<String>();

        List<SelectOption> postCodeOptions = new List<SelectOption>();
        postCodeOptions.add(new SelectOption('','-None-'));
        for (Address_Details__c addr: [SELECT Post_Code__c FROM Address_Details__c order by Post_Code__c ])
        {
           if(distintList.Contains(addr.Post_Code__c)== FALSE)
           {
              distintList.add(addr.Post_Code__c);
             postCodeOptions.add( new SelectOption(addr.Post_Code__c , addr.Post_Code__c));
            }
        }
              return postCodeOptions;
     }
     public List<SelectOption> getSuburbsOptions() 
     {
            Set<String> distintList = new Set<String>();
        List<SelectOption> SuburbOptions = new List<SelectOption>();
        SuburbOptions.add(new SelectOption('','-None-'));
        for (Address_Details__c addr: [SELECT Suburb_Name__c FROM Address_Details__c order by Suburb_Name__c])
        {
        if(distintList.Contains(addr.Suburb_Name__c)== FALSE)
           {
               distintList.add(addr.Suburb_Name__c);

          SuburbOptions.add( new SelectOption(addr.Suburb_Name__c , addr.Suburb_Name__c));
          }
        }
        return SuburbOptions;
      }
    
    
 
    public customPickListInVFDemoController(ApexPages.StandardController stdController) 
    {
            this.client = (Client__c)stdController.getRecord();
            Id id = ApexPages.currentPage().getParameters().get('id');
            client = (id == null) ? new Client__c() : 
            [SELECT Street_Address__c, Suburb__c, State__c, Postcode__c FROM Client__c WHERE Id = :id];
    }
  
    public PageReference save()
    {
      try 
      {
           update(client);
           }
      catch(System.DMLException e) 
      {
      ApexPages.addMessages(e);
        return null;
      }
      

       //  After Save, navigate to the default view page:
          return (new ApexPages.StandardController(client)).view();
          }
 
    public void onChangePostCode() 
     {
           //PostCodes= client.Postcode__c;
          
           Suburb ='';
           bRenderDetail =true;
      }
      public void onChangeSuburb() 
      {
           PostCodes ='';
         // Suburb =client.Suburb__c;
bRenderDetail= true;

       }    

   public void onchangeDetails() 
      {
           this.address = new Address_Details__c ();
           address = [SELECT Country_Name__c, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE id= :AddrId];
           client.Suburb__c= address.Suburb_Name__c ;
           client.State__c= address.State_Name__c ;
           client.Postcode__c= address.Post_Code__c ;
           bRenderDetail=false;
      
    }
    public List<SelectOption> getPopulatePostCodeSuburbList()
    {
        List<SelectOption> detailOptions = new List<SelectOption>();
         //detailOptions.add(new SelectOption('','-None-'));
        if(PostCodes!='')
        {
          for (Address_Details__c addr: [SELECT id, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE Post_Code__c= :PostCodes])
          {
            string  details = addr.State_Name__c + '-' + addr.City_Name__c + '-' + addr.Suburb_Name__c + + '-' + addr.Post_Code__c;
           
             detailOptions.add( new SelectOption(addr.id , details));
           }
        }
        else if (Suburb!='')
       {
          for (Address_Details__c addr: [SELECT id, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE Suburb_Name__c= :Suburb])
          {
             string details = addr.State_Name__c + '-' + addr.City_Name__c + '-' + addr.Suburb_Name__c + + '-' + addr.Post_Code__c;
           
             detailOptions.add( new SelectOption(addr.id , details));
          }
        }
        

        return detailOptions;

    }
   }




Test Class to Controller is


@isTest
 public class customPickListInVFDemoControllerTest
 {
    public static testmethod void testcustomPickListInVFDemoController()
    {
         
           // Create sample data.
           Client__c client = new Client__c ();
           client.Client_Family_Name__c = 'Testclientfamilyname';
           client.Given_Names__c = 'Testclientgivenname';
           client.Street_Address__c = '5 Osborne Avenue';
           client.Suburb__c = 'Springvale';
           client.Postcode__c = '3171';
           client.State__c = 'VIC';
           insert client;
  
    } 
}



And the Visual Force page code is 

User-added image



Your help will be highly appreciated


Thanks
Nitesh
Dear All,

 Greetings of the day!

 I have created an apex class and a VF page to display some data in XML format. I have developed it in one sandbox and it was working fine on  it and sample data was getting displayed in XML format through VF page, then realised that was not a true copy of production. so I made a true  copy of production on another sandbox, and then created the same apex class and VF page with same code and same naming conventions.

 For my surprise, the VF page is not displaying anything on this sandbox.

 Can anybody suggest, what could be the reason for this. 

 Below are codes

 VF Page
<apex:page Controller="StreamExample" contentType="text/xml" showHeader="true" sidebar="false" cache="false"> </apex:page>

Apex Class Code

public class StreamExample{
public StreamExample()
{
     XmlStreamWriter writer = new XmlStreamWriter();
    
    writer.writeStartDocument('utf-8', '1.0');        
    writer.writeStartElement(null, 'DEXFileUpload', null);
    writer.writeStartElement(null, 'Clients', null);
    
  
   writer.writeEndElement(); //closing tag for Clients
  writer.writeEndElement();//closing tag for Dex
    writer.close();
     
         
}
}
 

Thanks in Advance


Regards
Nitesh
Dear All,

Greetings of the day!

I am facing couple of issues with change set, as I am doing it first time. I tried creating inbound and outbound change set and have included all parts of new development on Sandbox. 

Still when I validate it on Production, it comes up with errors.
Would you be able to guide me out on how to get through it?

Attached below are the images from sandbox and production. 

Outbound Change Set is in Sandbox
Inbound Change Set is in Produciton

User-added image


User-added image

User-added image


Apex Controller class is 


public class customPickListInVFDemoController {
    public String Country { get; set; }
    public String City{ get; set; }
    public String Suburb { get; set; }
    public String ClientSuburb { get; set; }
    public String State { get; set; }
    public String PostCodes { get; set; }
    public String ClientState { get; set; }
    public String ClientPostCodes { get; set; }
    public Address_Details__c address { get; private set; }
    public Client__c client { get; private set; }
    public String AddrId {get; set;}
    public Id clientId;
   // public List<SelectOption> detailOptions{ get; set; }
   // public String details { get; set; }
    public Boolean bRenderDetail {get; set;}

 
//   TODO:  rename getCountriesOptions to getPostcodeOptions
    public List<SelectOption> getPostCodeOptions()
    {
         Set<String> distintList = new Set<String>();

        List<SelectOption> postCodeOptions = new List<SelectOption>();
        postCodeOptions.add(new SelectOption('','-None-'));
        for (Address_Details__c addr: [SELECT Post_Code__c FROM Address_Details__c order by Post_Code__c ])
        {
           if(distintList.Contains(addr.Post_Code__c)== FALSE)
           {
              distintList.add(addr.Post_Code__c);
             postCodeOptions.add( new SelectOption(addr.Post_Code__c , addr.Post_Code__c));
            }
        }
              return postCodeOptions;
     }
     public List<SelectOption> getSuburbsOptions() 
     {
            Set<String> distintList = new Set<String>();
        List<SelectOption> SuburbOptions = new List<SelectOption>();
        SuburbOptions.add(new SelectOption('','-None-'));
        for (Address_Details__c addr: [SELECT Suburb_Name__c FROM Address_Details__c order by Suburb_Name__c])
        {
        if(distintList.Contains(addr.Suburb_Name__c)== FALSE)
           {
               distintList.add(addr.Suburb_Name__c);

          SuburbOptions.add( new SelectOption(addr.Suburb_Name__c , addr.Suburb_Name__c));
          }
        }
        return SuburbOptions;
      }
    
    
 
    public customPickListInVFDemoController(ApexPages.StandardController stdController) 
    {
            this.client = (Client__c)stdController.getRecord();
            Id id = ApexPages.currentPage().getParameters().get('id');
            client = (id == null) ? new Client__c() : 
            [SELECT Street_Address__c, Suburb__c, State__c, Postcode__c FROM Client__c WHERE Id = :id];
    }
  
    public PageReference save()
    {
      try 
      {
           update(client);
           }
      catch(System.DMLException e) 
      {
      ApexPages.addMessages(e);
        return null;
      }
      

       //  After Save, navigate to the default view page:
          return (new ApexPages.StandardController(client)).view();
          }
 
    public void onChangePostCode() 
     {
           //PostCodes= client.Postcode__c;
          
           Suburb ='';
           bRenderDetail =true;
      }
      public void onChangeSuburb() 
      {
           PostCodes ='';
         // Suburb =client.Suburb__c;
bRenderDetail= true;

       }    

   public void onchangeDetails() 
      {
           this.address = new Address_Details__c ();
           address = [SELECT Country_Name__c, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE id= :AddrId];
           client.Suburb__c= address.Suburb_Name__c ;
           client.State__c= address.State_Name__c ;
           client.Postcode__c= address.Post_Code__c ;
           bRenderDetail=false;
      
    }
    public List<SelectOption> getPopulatePostCodeSuburbList()
    {
        List<SelectOption> detailOptions = new List<SelectOption>();
         //detailOptions.add(new SelectOption('','-None-'));
        if(PostCodes!='')
        {
          for (Address_Details__c addr: [SELECT id, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE Post_Code__c= :PostCodes])
          {
            string  details = addr.State_Name__c + '-' + addr.City_Name__c + '-' + addr.Suburb_Name__c + + '-' + addr.Post_Code__c;
           
             detailOptions.add( new SelectOption(addr.id , details));
           }
        }
        else if (Suburb!='')
       {
          for (Address_Details__c addr: [SELECT id, Suburb_Name__c, City_Name__c, State_Name__c, Post_Code__c FROM Address_Details__c WHERE Suburb_Name__c= :Suburb])
          {
             string details = addr.State_Name__c + '-' + addr.City_Name__c + '-' + addr.Suburb_Name__c + + '-' + addr.Post_Code__c;
           
             detailOptions.add( new SelectOption(addr.id , details));
          }
        }
        

        return detailOptions;

    }
   }




Test Class to Controller is


@isTest
 public class customPickListInVFDemoControllerTest
 {
    public static testmethod void testcustomPickListInVFDemoController()
    {
         
           // Create sample data.
           Client__c client = new Client__c ();
           client.Client_Family_Name__c = 'Testclientfamilyname';
           client.Given_Names__c = 'Testclientgivenname';
           client.Street_Address__c = '5 Osborne Avenue';
           client.Suburb__c = 'Springvale';
           client.Postcode__c = '3171';
           client.State__c = 'VIC';
           insert client;
  
    } 
}



And the Visual Force page code is 

User-added image



Your help will be highly appreciated


Thanks
Nitesh