+ Reply to Thread
Results 1 to 2 of 2

Thread: mass convert leads using a flow

  1. #1
    Hosting Master johnwest is on a distinguished road
    Join Date
    May 2014
    Location
    India
    Posts
    158

    mass convert leads using a flow

    I have 100k Leads in the system that I wish to convert to Accounts. Some of them already exist as Accounts in this Salesforce dashboard and need to be merged into the existing Account records, and others are new and need to be created as new Accounts.

    I created a flow, that gets all the leads I wish to convert (Marked them with checkbox to make some tests), and I'm performing a Loop on all of them.

    For some reason, the Flow always fails to run.
    Is there someone here that used a Flow to convert bulk amount of Leads?
    Would be grat if there's someone that can suggest solution to mass convert.

  2. #2
    Hosting Master jasmin.london is on a distinguished road
    Join Date
    Sep 2017
    Location
    India
    Posts
    102
    The total number of records that can be returned by SOQL queries in Salesforce a request is 50,000. I would say go with batch apex because when you split into batches every transaction starts with a new set of governor limits, making it easier to ensure that your code stays within the governor execution limits

    Also, @InvocableMethod can be used in batch apex. Here is an example code

    Code:
    global class ContactBatch implements Database.Batchable<sObject> {
    
      @InvocableMethod(label='exuete the batch ContactBatch' description='This method will be execute ContactBatch')
      public static void executeBatchMethod(List<String> lst) {
        Database.executeBatch(new ContactBatch(), 200);
      }
      
        global static Database.QueryLocator start(Database.BatchableContext BC) {
            String query = 'SELECT Id,Phone FROM Contact';
            return Database.getQueryLocator(query);
        }
        global void execute(Database.BatchableContext BC, List<Contact> accList) {  
            for(Contact acc : accList)
            {        
                acc.Phone = '9941855438';
            }
            try {
                update accList;
            } catch(Exception e) {
                System.debug(e);
            }  
        }   
        global void finish(Database.BatchableContext BC) {
      }
    }

+ Reply to Thread

Similar Threads

  1. How can Web Analytics help generating leads?
    By himanshu in forum Search Engine Optimization
    Replies: 3
    Last Post: 06-13-2019, 06:33 AM
  2. What is Citation Flow?
    By gitanistone in forum Programming Discussion
    Replies: 0
    Last Post: 01-14-2019, 06:37 AM
  3. How to generate leads from Facebook Ads or advertisement?
    By johnwest in forum Search Engine Optimization
    Replies: 12
    Last Post: 06-25-2018, 05:43 PM
  4. What is the best technique to generate leads?
    By ankitasharma123 in forum Search Engine Optimization
    Replies: 8
    Last Post: 01-22-2018, 07:14 AM
  5. Mass email technique to attract attention
    By wilo in forum Running a Web Hosting Business
    Replies: 4
    Last Post: 01-21-2006, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts