• P5
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 6
    Replies
I am using  ANT tool to get data from org .Then i need to deploy to another org.

How can i get Reports and dashboards in to my local folder?
How can i retrieve them from one org?
Also email templates?
Do i need to indivdually get field updates and other?or just workflow rule brings them?

Thank you .
Hello,
Here i am tried to write a test class for importing csv file.THere is no code coverage.Plese help me on this.

Controller Class-
public class adminPriorSale {
    public list<Sales__c> accon{get;set;}
    public Sales__c agnt{get;set;}
    
    public Blob csvFileBody{get;set;}
    public string csvAsString{get;set;}
    public String[] csvFileLines{get;set;}
    
    public adminPriorSale(apexpages.standardcontroller controller )
   {
     agnt = new Distributor_Prior_Sales__c();
     accon = New List<Distributor_Prior_Sales__c>(); 
     accon=[selectid,Name,SMS_sales_amount__c,SMS_Year__c,Exhibit_A_Customer__c,Calculation_Type__c from Distributor_Prior_Sales__c]; 
     csvFileLines = new String[]{};
     
     }

public void importCSVFile(){
        
       try{
              csvAsString = csvFileBody.toString();
              csvFileLines = csvAsString.split('\n'); 
              for(Integer i=0;i<csvFileLines.size();i++){
               Sales__c prisale = new Sales__c () ;
               string[] csvRecordData = csvFileLines[i].split(',');
               prisale.Year__c= csvRecordData[0] ;             
               prisale.sales_amount__c= Decimal.valueof(csvRecordData[1]);
               prisale.Customer__c= csvRecordData[2];
               prisale.Calculation_Type__c = csvRecordData[3];   
               accon.add(prisale); 
             
           }
        upsert accon;
        
        }
        catch (Exception e)
        {
            ApexPages.Message errorMessage = new ApexPages.Message(ApexPages.severity.ERROR,e.getMessage());
            ApexPages.addMessage(errorMessage);
        } 
        
  } 
}   



Testclass-
 @isTest
private class test_ExhibitAadminPriorSale {
    static testMethod void test_ExhibitAadminPriorSale4()
    { 
      //  Distributor_Prior_Sales__c   t1= new Distributor_Prior_Sales__c  ();
        //t1.Name='test1';
        //t1.SMS_sales_amount__c =123;
        //t1.SMS_Year__c='2014';
       // insert t1;
  
      
        Document lstDoc = [select id,name,Body from Document where name = 'accttest'];
 
        ExhibitAadminPriorSale file=new ExhibitAadminPriorSale ();
        file.fileAccess();
        Blob content= lstDoc.Body;
        file.csvFileBody = content; 
        file.importCSVFile(); 

file.csvAsString =content.toString();
String[] csvFileLines = new String[]{};
List accon;

accon = new List();
for (Integer i=1;i<csvFileLines.size();i++)
{
String[] csvRecordData = new String[]{};
csvRecordData = csvFileLines [i].split(',');
//Distributor_Prior_Sales__c a = new Distributor_Prior_Sales__c ();
Distributor_Prior_Sales__c   t1= new Distributor_Prior_Sales__c  ();
        t1.Name='test1';
        t1.SMS_sales_amount__c =123;
        t1.SMS_Year__c='2012';
        t1.Exhibit_A_Customer__c='I Architects';
        t1.Calculation_Type__c='Estimated Prior sales';
        t1.RecordTypeId = '0011900000AFc6c';

accon.add(t1); 
try{
      insert accon;
}
catch (Exception e)
{
      ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template');
      ApexPages.addMessage(errormsg);
}

}
}
 
  • October 12, 2015
  • Like
  • 0

Hi Guys,

 

I have a scenario. Please someone help me ! 

I want a CUSTOM Created Date Time  Field in CASE OBJECT. 

This Field should have values based on Working Hours . 

Monday to Thursday - 8 AM to 4 PM 

Friday - 8 AM to 3 PM 

SATURDAY and SUNDAY - HOLIDAY 


FOR EXAMPLE :Case created by 4:01 PM on Monday, the value of Custom Created date field should be TUESDAY 8 AM .
If a Case is created by 3:01 PM on friDAY, the value of Custom field should be MONDAY 8 AM . 

Please help me with this scenario  !  



How to set Header and Footer in Visualforce email tamplate?

This should be simple, but I'm having a hard time with it. I want to create a formula field that gives me the number of minutes between the record's CreateDate and LastModifiedDate. What does that formula need to look like?

 

Thanks for your help!


Hi,
 
  Is there any way to upload the static resources through ant?
  If yes can you just share what is the name attribute you are using for that.
  I tried with StaticResource, I am getting blank xml. So any suggestions will be highly appreciated.



  • September 08, 2008
  • Like
  • 0