• Pankaj Parihar
  • NEWBIE
  • 30 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 10
    Replies
hello friends 
can any one tell me the proper code for Merging duplicate records, i have merged files but not able to delete duplicate files.
global class batch3 implements Database.Batchable<sObject> {
    
    global Database.QueryLocator start(Database.BatchableContext BC) {
 		
        String query = 'SELECT Id,Name,Name__c,MobilePhone,Email,AnnualRevenue,LeadSource FROM Lead';
        return Database.getQueryLocator(query);
      
    }
    global void execute(Database.BatchableContext BC, List<Lead> leadlist) 
    {
        for( Lead a : leadlist)
       {
           for(Lead b: leadlist)
           { 
          		if(a.Name__c == b.Name__c )
                {
                    if(a.MobilePhone== null)
                    {
                        a.MobilePhone=b.MobilePhone;
                    }
                    if(a.Email== null)
                    {
                        a.Email=b.Email;
                    }
                    if(a.AnnualRevenue== null)
                    {
                        a.AnnualRevenue=b.AnnualRevenue;
                    }
                    if(a.LeadSource== null)
                    {
                        a.LeadSource=b.LeadSource;
                    }
                    //delete  b;
                    //[select id from Lead where Name__c='b.Name__c'];
                   	/* Lead[] dlist1 = [SELECT Id, Name FROM Lead WHERE Name__c = 'b.Name__c']; 
						try 
                        {
    						delete dlist1;
						}
                    	catch (DmlException e) 
                        {
    						// Process exception here
						}
					*/
               }
             	
           }
          // update a;
       }
      /* 	system.debug('leadlist a>>>>>'+leadlist);
        system.debug('outside loop>>>>>');
        list<lead> list1=new list<lead>();
      for( Lead a : leadlist)
       {
           for(Lead b: leadlist)
           {
          		if(a.Name__c != b.Name__c )
                {
                   list1.add(a);
                }
               else
                {
                    
                }
           }
           update a;
       }
       // List<Lead> list2 = new List<Lead>(list1);
        */  update leadlist;
        
    }   
     
    global void finish(Database.BatchableContext BC) {
      
  }
}
plz correct in this.
 
Hi friends
i want a trigger code for this
When a contact is made primary(1) the city of the contact should be updated in the Account’s city(3) field. User-added image
hi plz help me with batch code or tell me the flow step by step.
Create the following custom objects and establish the relationships as mentioned below:
Custom object called Policy
Junction object between standard Account object and Policy custom object called Account/Policy relationship
Junction object between standard User object and Policy custom object called Policy/Agent relationship
Enable Account teams in the Org.
Assume that there are more than 4 million Account records, 2 million Policy records, 1 million Account/Policy relationship records and 1 million Policy/Agent relationship records in the Org.
Scenario is to add all the Users related to a Policy via Agent/Policy relationship records to the Account teams of Accounts related to the Same Policy via Account/Policy relationship.
hi friends 
plz hepl me in this queue thing just tell me how to do.. coding also if possible

Assign all the leads created during non-business hours to specified queue and leads created during business hours to specified queue.
hi piush
can u help me in this batch program same createdby date related Assign all the leads created during non-business hours to specified queue and leads created during business hours to specified queue.
User-added image
hi friends 
i wanted to acess date and time  separately how can i get it
through batch code
hello
plz help me in this trigger code

If owner of an Account has gone on leave for more than 90 days then type field should be updated with "Former Client".
If owner of an Account has gone on leave for more than 180 days and if the owner has a delegated user then the delegated user should be updated as Owner.
If owner of an Account has gone on leave for more than 180 days and if the owner has no delegated user then type field should be updated with "Deactivated".
hi
sir, plz help me with the code i m very fresh to codeing and salesforce 
Campaigns should contain both Leads and Contacts as Campaign Members.
Either Lead or Contact of Campaign Members cumulative amount whichever is greater should be updated in Campaign object - Cumulative Amount of Leads or Contacts.
 
hi friends 
help me plz .tell me the 2 Approval Process
1) Create a two-step expense report approval process for all employees in your headquarters office. It specifies that expenses less than $50 are automatically approved, those $50 and over require manager approval, and those over $5,000 require additional approval from two VPs. This example highlights the “else” option, as well as the parallel approvals feature.
2) Orders that are discounted more than 40% require a CEO approval.
Remind the opportunity owner and senior management when the close date is approaching for a large deal, an opportunity that has an amount greater than $100,000. Also, create a follow-up task for the opportunity owner if the deal is still open when the close date passes.
hello friends 
plz help me with the code.
Based on the probability, calculate the amount for each product and display the amount.
Display the cumulative amount in Opportunity object only if the cumulative probability has crossed 50%.
hi friends
Update the Shipment Status field to “Delayed” if a shipment has exceeded the expected delivery date and not reached the customer.
plz tell me the steps to do this workflow
hello friends
i m new to programming ...i dont know how to write batch code. plz help me with code.
2 casestudys are there i need both the questions.

CaseStudy Batch 1
1.Merging duplicate records in leads based on first name and last name. Batch should run every day. 

CaseStudy Batch 2
1.Assign all the leads created during non-business hours to specified queue and leads created during business hours to specified queue.
hello
plz direct me with sutable workflow to this question.
1.The sales VP wants to know about any cases filed for top accounts, where top accounts are determined by size and revenue.
plz tell me all the steps.
Hello friends
stucked in this question
1.Set the case target resolution date for accounts that have basic support level to 30 days from today.
plz help me in completing this workflow with steps.i dont know codding.
 
Hi All
Notify the VP of Sales when a deal is lost if the stage was “Proposal/Price Quote” and the amount was greater than $1,000,000. plz help me in steps how to do code if required..
plz help with code
Merging duplicate records in leads based on first name and last name. Batch should run every day.
 
product table
hello 
i need to display this table on vf page on a button click which is inside of an opportunity record.
plz help me with code.
hi
Update the Shipment Status field to “Delayed” if a shipment has exceeded the expected delivery date and not reached the customer.
product table
hello 
i need to display this table on vf page on a button click which is inside of an opportunity record.
plz help me with code.
hi
Update the Shipment Status field to “Delayed” if a shipment has exceeded the expected delivery date and not reached the customer.
hello friends 
can any one tell me the proper code for Merging duplicate records, i have merged files but not able to delete duplicate files.
global class batch3 implements Database.Batchable<sObject> {
    
    global Database.QueryLocator start(Database.BatchableContext BC) {
 		
        String query = 'SELECT Id,Name,Name__c,MobilePhone,Email,AnnualRevenue,LeadSource FROM Lead';
        return Database.getQueryLocator(query);
      
    }
    global void execute(Database.BatchableContext BC, List<Lead> leadlist) 
    {
        for( Lead a : leadlist)
       {
           for(Lead b: leadlist)
           { 
          		if(a.Name__c == b.Name__c )
                {
                    if(a.MobilePhone== null)
                    {
                        a.MobilePhone=b.MobilePhone;
                    }
                    if(a.Email== null)
                    {
                        a.Email=b.Email;
                    }
                    if(a.AnnualRevenue== null)
                    {
                        a.AnnualRevenue=b.AnnualRevenue;
                    }
                    if(a.LeadSource== null)
                    {
                        a.LeadSource=b.LeadSource;
                    }
                    //delete  b;
                    //[select id from Lead where Name__c='b.Name__c'];
                   	/* Lead[] dlist1 = [SELECT Id, Name FROM Lead WHERE Name__c = 'b.Name__c']; 
						try 
                        {
    						delete dlist1;
						}
                    	catch (DmlException e) 
                        {
    						// Process exception here
						}
					*/
               }
             	
           }
          // update a;
       }
      /* 	system.debug('leadlist a>>>>>'+leadlist);
        system.debug('outside loop>>>>>');
        list<lead> list1=new list<lead>();
      for( Lead a : leadlist)
       {
           for(Lead b: leadlist)
           {
          		if(a.Name__c != b.Name__c )
                {
                   list1.add(a);
                }
               else
                {
                    
                }
           }
           update a;
       }
       // List<Lead> list2 = new List<Lead>(list1);
        */  update leadlist;
        
    }   
     
    global void finish(Database.BatchableContext BC) {
      
  }
}
plz correct in this.
 
Hi friends
i want a trigger code for this
When a contact is made primary(1) the city of the contact should be updated in the Account’s city(3) field. User-added image
User-added image
hi friends 
i wanted to acess date and time  separately how can i get it
through batch code
Remind the opportunity owner and senior management when the close date is approaching for a large deal, an opportunity that has an amount greater than $100,000. Also, create a follow-up task for the opportunity owner if the deal is still open when the close date passes.
hello friends 
plz help me with the code.
Based on the probability, calculate the amount for each product and display the amount.
Display the cumulative amount in Opportunity object only if the cumulative probability has crossed 50%.
Hi All
Notify the VP of Sales when a deal is lost if the stage was “Proposal/Price Quote” and the amount was greater than $1,000,000. plz help me in steps how to do code if required..
plz help with code
Merging duplicate records in leads based on first name and last name. Batch should run every day.
 
product table
hello 
i need to display this table on vf page on a button click which is inside of an opportunity record.
plz help me with code.