• mahe_developer
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi All,

 

I want to add lead history as related history in Custom lead view visul force page, as below....

 

<apex:relatedList list="ActivityHistories" /> like  what is for lead history tracking?????

 

 

Thanks.......

 

Mahendra

Hi All,

 

I need to write a email based workflow on Account for" If no activities for a account morethan 60 days, an email should fire to account owner and to his manager ", here actvities are emails,calls.How can i achieve this functionality using workflows.

 

 

Thanks

 

Mahendra

Dear All,

 

I want to retrieve data from object based on Queues like roles, can somebody help me in this, possible  send me sample code ...

 

Thanks In Advance..

 

 

mahesh

My Client requested  to add middle name in Lead tab, But that middle name is not appending to whole name, how can i append middle name to whole name, how can i modify standard funcyionality....

 

 

Thanks 

 

Mahesh

Hi,

 

         All My test classes average  code coverage is 84%, But i am always getting Average test coverage across all Apex Classes and Triggers is 73%, at least 75% test coverage is required error while deploying into Production.

What Might be the Problem with this.

 

 

Thanks

 

Mahesh....

Dear All,

 

 I am not able to Increase the code coverage for following code Indiacted with Red color, over all i got 45 % of test coverage.Can somebody help me...

 

Thanks 

 

Mahesh

 

public class metric4 {
 2	  List<Opportunity> OppList = new List<Opportunity>();
 3	   List<User> UserList = new List<User>();
 4	   public Id selectedUser{set;get;}
 5	   public List<SelectOption> usersList{set;get;}
 6	   public list<opportunity>oppolist{set;get;}
 7	   public String selectedopportunity{set;get;}
 8	   public List<SelectOption>opportunityList{set;get;}
 9	   public boolean showOpportunity{set;get;}
 10	   public boolean showRFQ{set;get;}
 11	   public boolean showProposalSent{set;get;}
 12	   public boolean showNegotiation{set;get;}
 13	   public boolean showClosedLost{set;get;}
 14	   public boolean showOpportunityScrapped{set;get;}
 15	   public boolean showOnHold{set;get;}
 16	   public boolean showClosedWon{set;get;}
 17	   public list<opportunity> listOpp1{set;get;}
 18	   public String strSelectedUser;
 19	   public String strSelectedStage;
 20	  
 21	   public Metric4()
 22	   {
 23	   }
 24	  public List<SelectOption>getUsers()
 25	   {
 26	   List<User> users = [select Id,name from User where isActive=true];
 27	   usersList = new List<SelectOption>();
 28	   usersList.add(new SelectOption('','-None-'));
 29	   for(User u:users)
 30	   {
 31	   usersList.add(new SelectOption(u.Id,u.name));
 32	   }
 33	   return usersList;
 34	   }
 35	   public List<SelectOption>getopportunities()
 36	   {
 37	   opportunityList = new List<SelectOption>();
 38	   opportunityList.add(new SelectOption('','-None-'));
 39	   opportunityList.add(new SelectOption('Opportunity','Opportunity'));
 40	   opportunityList.add(new SelectOption('RFQ','RFQ'));
 41	   opportunityList.add(new SelectOption('Proposal Sent','Proposal Sent'));
 42	   opportunityList.add(new SelectOption('Negotiation/Review','Negotiation/Review'));
 43	   opportunityList.add(new SelectOption('Closed Lost','Closed Lost'));
 44	   opportunityList.add(new SelectOption('Opportunity Scrapped','Opportunity Scrapped'));
 45	   opportunityList.add(new SelectOption('Closed Won','Closed Won'));
 46	   opportunityList.add(new SelectOption('On Hold','On Hold'));
 47	   return opportunityList;
 48	   }
 49	  
 50	   public void submit()
 51	   {
 52	   strSelectedUser = selectedUser;
 53	   System.Debug('----ANITHA----------Selected User------------------------'+strSelectedUser);
 54	   strSelectedStage = selectedopportunity;
 55	   System.Debug('----ANITHA----------Selected Stage-----------------------'+strSelectedStage);
 56	   System.Debug('----ANITHA----------Selected Proposal Sent TRUE/FALSE----'+showProposalSent);
 57	   getOpt();
 58	   listOpp1 = [select Id,Description,name,Opportunity_Days__c,Opportunity_Duration__c,
 59	   RFQ__c,RFQ_Days__c,RFQ_Duration__c,Proposal_Sent_Days__c,Proposal_Sent_Duration__c,
 60	   Negotiation_Duration__c,Negotiation_review__c,Closed_Lost__c,Closed_Lost_Duration__c,
 61	   Opportunity_Scrapped_Dyas__c,Opportunity_Scrapped_Duration__c,
 62	   Closed_Won__c,Closed_Won_Duration__c,On_Hold_Days__c,On_Hold_Duration__c
 63	   from opportunity
 64	   where OwnerId =: strSelectedUser AND stagename =: strSelectedStage];
 65	   system.debug('----ANITHA----------Oppartunity Onject Values-------------'+listOpp1);
 66	   }
 67	   public List<Opportunity> getOpt()
 68	   {
 69	   listopp1 = [select Id,Description,name,Opportunity_Days__c,RFQ_Days__c,Proposal_Sent_Days__c, Negotiation_review__c,Closed_Lost__c, Opportunity_Scrapped_Dyas__c, Closed_Won__c,On_Hold_Days__c from opportunity where OwnerId =: selectedUser AND stagename =: selectedopportunity];
 70	   if(selectedopportunity == 'Opportunity')
 71	   {
 72	   showOpportunity = true;
 73	   showRFQ = false;
 74	   showProposalSent = false;
 75	   showNegotiation = false;
 76	   showClosedLost= false;
 77	   showOpportunityScrapped= false;
 78	   showOnHold= false;
 79	   showClosedWon = false;
 80	   }
 81	   else if (selectedopportunity == 'RFQ')
 82	   {
 83	   showRFQ = true;
 84	   showOpportunity = false;
 85	   showProposalSent = false;
 86	   showNegotiation = false;
 87	   showClosedLost= false;
 88	   showOpportunityScrapped= false;
 89	   showOnHold= false;
 90	   showClosedWon = false;
 91	   }
 92	   else if (selectedopportunity == 'Proposal Sent')
 93	   {
 94	   showProposalSent = true;
 95	   showOpportunity = false;
 96	   showRFQ = false;
 97	   showNegotiation = false;
 98	   showClosedLost= false;
 99	   showOpportunityScrapped= false;
 100	   showOnHold= false;
 101	   showClosedWon = false;
 102	   }
 103	   else if (selectedopportunity == 'Negotiation/Review')
 104	   {
 105	   showNegotiation = true;
 106	   showProposalSent = false;
 107	   showOpportunity = false;
 108	   showRFQ = false;
 109	   showClosedLost= false;
 110	   showOpportunityScrapped= false;
 111	   showOnHold= false;
 112	   showClosedWon = false;
 113	   }
 114	   else if (selectedopportunity == 'Closed Lost')
 115	   {
 116	   showClosedLost = true;
 117	   showNegotiation = false;
 118	   showProposalSent = false;
 119	   showOpportunity = false;
 120	   showRFQ = false;
 121	   showOpportunityScrapped= false;
 122	   showOnHold= false;
 123	   showClosedWon = false;
 124	   }
 125	   else if (selectedopportunity == 'Opportunity Scrapped')
 126	   {
 127	   showOpportunityScrapped = true;
 128	   showClosedLost = false;
 129	   showNegotiation = false;
 130	   showProposalSent = false;
 131	   showOpportunity = false;
 132	   showRFQ = false;
 133	   showOnHold= false;
 134	   showClosedWon = false;
 135	   }
 136	   else if (selectedopportunity == 'Closed Won')
 137	   {
 138	   showClosedWon = true;
 139	   showOpportunityScrapped = false;
 140	   showClosedLost = false;
 141	   showNegotiation = false;
 142	   showProposalSent = false;
 143	   showOpportunity = false;
 144	   showRFQ = false;
 145	   showOnHold= false;
 146	   }
 147	   else if (selectedopportunity == 'On Hold'){
 148	   showOnHold = true;
 149	   showClosedWon = false;
 150	   showOpportunityScrapped = false;
 151	   showClosedLost = false;
 152	   showNegotiation = false;
 153	   showProposalSent = false;
 154	   showOpportunity = false;
 155	   showRFQ = false;
 156	   }
 157	   return listOpp1;
 158	   }
 159	  
 160	  
 161	  
 162	   //*********************************** Test Method ********************************
 163	  
 164	  
 165	  
 166	  
 167	  static testmethod void tt(){
 168	   metric4 mm = new metric4();
 169	   mm.getopportunities();
 170	   mm.getUsers();
 171	   mm.submit();
 172	   List<Opportunity> opt = mm.getOpt();
 173	   mm.showOpportunity = True ;
 174	   mm.showRFQ = true;
 175	   mm.showProposalSent = false;
 176	   mm.showNegotiation = false;
 177	   mm.showClosedLost= false;
 178	   mm.showOpportunityScrapped= false;
 179	   mm.showOnHold= false;
 180	   mm.showClosedWon = false;
 181	  
 182	  
 183	   Account a = new Account ();
 184	   a.Name = 'Bodhtree';
 185	   a.CurrencyIsoCode = 'USD';
 186	   insert a ;
 187	   String showOpportunity = 'Opportunity' ;
 188	   Boolean showOpportunityb ;
 189	   Opportunity o = new opportunity();
 190	   o.name = 'Mahendra';
 191	   o.CloseDate = system.today();
 192	   o.AccountId = a.Id ;
 193	   o.stagename = 'Opportunity';
 194	   if(showOpportunity == 'Opportunity')
 195	   {
 196	  
 197	   showOpportunityb = True;
 198	   }
 199	   insert o;
 200	  
 201	   Opportunity o1 = new opportunity();
 202	   o1.stagename = 'RFQ';
 203	   o1.name = 'Mahendra';
 204	   o1.CloseDate = system.today();
 205	   o1.AccountId = a.Id ;
 206	   insert o1;
 207	  
 208	   System.currentPageReference().getParameters().put('tabName',o1.Id);

 

 

 

I need to set up a eamil based workflow ,based some conditions an email should go to account owner and his manager.

But in Recipient Type i am getting only account owner, how can i get Account Owner manager as option in Recipient Type.

Thanking you

 





Hi,

 

      I wrote trigger on Lead for auto firing of  'Submit for Approval' request once the Lead is Qualified, its working fine in Sandbox , how to write test method for this trigger, Can anybody send the sample test methods.

 

Thanks In Advance....

______________________________________________________________________________

 

trigger trigger_auto_request on Lead (after insert,after update) {
    {
 
       for (Integer i = 0; i < Trigger.new.size(); i++) 
           {
                if (Trigger.new[i].status =='Qualified' ) 
                    {
                         Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
                         req.setComments('Submitted for approval. Please approve.');
                         req.setObjectId(Trigger.new[i].Id);
                         Approval.ProcessResult result = Approval.process(req);
                         System.debug('Submitted for approval successfully: '+result.isSuccess());
 
                    }
 
           }
 
    }

}
_____________________________________________________________________________________

 

Mahesh...........

Hi Friends,

 

              I have opportunity ,Salesorder, Projects and Milestones Objects,For opportunity salesorder is detail list, for sales order project is detail list and for projects milestone is detail list, so suppose if i created all records for opportunity, when i click on opportunity name from all objects related lists should apper in opportunity  page as detail lists.Is it possible?

 

 

Thansk

Mahesh.......

 

HI ,

 I have a requirement like this.....

If no activity in account for 2 months an alert goes to Account Owner , how can i achieve this functionality?

 

Thanks in Adv..

 

 

Mahesh

Hi All,

 

   In Opportunity I have created one Custom field named TYPE  as filed Pick list Values are (New Business,Existing business), i have requirement like this when ever a opportunity created first time for account, Opportunity-TYPE Pick value should be Normal Business and if going on creating multiple opportunities for a single account, the opportunity-Type should be Existing Business...

 

Account.Infosys----Opportunity1 is CISCO...  TYPE----New Business

Account INfosys---Opportunity 2 is Ampro...TYPE----  eXISTING bUSINESS..

-

-

-

 

Mahesh

Hi All,

 

 Can anybody help me, when ever lead is qualified  need to get approved by manager, tell me what are the steps, flow required to perform this task.

 

 

Thnaks in Adv..

 

Mahesh

Hi,

 

I have Got requirement like this....When ever a account created, some of the fields from account should automatically populate into Opportunity , that means when i click new opportuinity some of the accounts fields should appear there..

 

 

 

How to Know API name of product

Hi,

 

         All My test classes average  code coverage is 84%, But i am always getting Average test coverage across all Apex Classes and Triggers is 73%, at least 75% test coverage is required error while deploying into Production.

What Might be the Problem with this.

 

 

Thanks

 

Mahesh....