• Cheryl L @ Mercury
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Can someone help.  I am in Eclipse and can not get to my classes and triggers in Salesforce Production ( I need to delete them).  When I do File New, Force.com IDE Project, it tells me "Problem Opening Wizard", the selected wizard can not be started.  I tried others, same error.  How do I get to my Salesforce through Eclipse 

I need some help creating a test code or some how making my Class pass Code Coverage - it currently has 0% and I can't deploy to Production.

 

How do I get this Class to pass.

 

public class NewDealerApproval {

    // Author: Cheryl Lefeber

   

    static final Map<String,Approval_Matrix_New_Dealer__c> APPROVAL_MAP_CONST;

   

    static {

        APPROVAL_MAP_CONST = getNewDealerApprovalMap();

    }

   

    private static Map<String,Approval_Matrix_New_Dealer__c> getNewDealerApprovalMap(){

        // build a Map from Reps (concatenated Field Rep and Service Rep) --> Approval Matrix New Dealer record

        Map<String,Approval_Matrix_New_Dealer__c> results = new Map<String,Approval_Matrix_New_Dealer__c>();

        List<Approval_Matrix_New_Dealer__c> records = [select id,name,Reps__c,

        Final_Approver_BDM__c,Final_Approver_TAM__c,Final_Approver_RBD__c,Account_rep__c,

        Final_Approver_FSD__c,Pre_Approver_TAM__c,Pre_Approver_BDM__c  from Approval_Matrix_New_Dealer__c];

        for(Approval_Matrix_New_Dealer__c record : records){

         if (!results.containsKey(record.Reps__c))

 

results.put(record.Reps__c, record);

        }

        return results;

        }

  

       public static void setNewDealerApprovers(Application__c[] applications){

        for (Application__c p:applications){

            if (p.reps__c != null) {

                if ( APPROVAL_MAP_CONST.containsKey(p.Reps__c))

{

                    p.final_approver_BDM__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_BDM__c;

                    p.final_approver_TAM__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_TAM__c;

                    p.final_approver_RBD__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_RBD__c;

                    p.final_approver_FSD__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_FSD__c;

                    p.pre_approver_BDM__c = APPROVAL_MAP_CONST.get(p.Reps__c).pre_approver_BDM__c;

                    p.pre_approver_TAM__c = APPROVAL_MAP_CONST.get(p.Reps__c).pre_approver_TAM__c;

                    p.account_rep__c = APPROVAL_MAP_CONST.get(p.Reps__c).account_rep__c;

               } else {

                    p.final_approver_BDM__c=null;

                    p.final_approver_TAM__c=null;

                    p.final_approver_RBD__c=null;

                    p.final_approver_FSD__c=null;

                    p.pre_approver_BDM__c=null;

                    p.pre_approver_TAM__c=null;

                    p.account_rep__c=null;

 

                }

            }

        }

    }

}

Can someone help.  I am in Eclipse and can not get to my classes and triggers in Salesforce Production ( I need to delete them).  When I do File New, Force.com IDE Project, it tells me "Problem Opening Wizard", the selected wizard can not be started.  I tried others, same error.  How do I get to my Salesforce through Eclipse 

I need some help creating a test code or some how making my Class pass Code Coverage - it currently has 0% and I can't deploy to Production.

 

How do I get this Class to pass.

 

public class NewDealerApproval {

    // Author: Cheryl Lefeber

   

    static final Map<String,Approval_Matrix_New_Dealer__c> APPROVAL_MAP_CONST;

   

    static {

        APPROVAL_MAP_CONST = getNewDealerApprovalMap();

    }

   

    private static Map<String,Approval_Matrix_New_Dealer__c> getNewDealerApprovalMap(){

        // build a Map from Reps (concatenated Field Rep and Service Rep) --> Approval Matrix New Dealer record

        Map<String,Approval_Matrix_New_Dealer__c> results = new Map<String,Approval_Matrix_New_Dealer__c>();

        List<Approval_Matrix_New_Dealer__c> records = [select id,name,Reps__c,

        Final_Approver_BDM__c,Final_Approver_TAM__c,Final_Approver_RBD__c,Account_rep__c,

        Final_Approver_FSD__c,Pre_Approver_TAM__c,Pre_Approver_BDM__c  from Approval_Matrix_New_Dealer__c];

        for(Approval_Matrix_New_Dealer__c record : records){

         if (!results.containsKey(record.Reps__c))

 

results.put(record.Reps__c, record);

        }

        return results;

        }

  

       public static void setNewDealerApprovers(Application__c[] applications){

        for (Application__c p:applications){

            if (p.reps__c != null) {

                if ( APPROVAL_MAP_CONST.containsKey(p.Reps__c))

{

                    p.final_approver_BDM__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_BDM__c;

                    p.final_approver_TAM__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_TAM__c;

                    p.final_approver_RBD__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_RBD__c;

                    p.final_approver_FSD__c = APPROVAL_MAP_CONST.get(p.Reps__c).final_approver_FSD__c;

                    p.pre_approver_BDM__c = APPROVAL_MAP_CONST.get(p.Reps__c).pre_approver_BDM__c;

                    p.pre_approver_TAM__c = APPROVAL_MAP_CONST.get(p.Reps__c).pre_approver_TAM__c;

                    p.account_rep__c = APPROVAL_MAP_CONST.get(p.Reps__c).account_rep__c;

               } else {

                    p.final_approver_BDM__c=null;

                    p.final_approver_TAM__c=null;

                    p.final_approver_RBD__c=null;

                    p.final_approver_FSD__c=null;

                    p.pre_approver_BDM__c=null;

                    p.pre_approver_TAM__c=null;

                    p.account_rep__c=null;

 

                }

            }

        }

    }

}

I'm using Eclipse for the very first time.  I've installed Eclipse.  How do I connect to our SalesForce sandbox using Eclipse?
 
Thanks.