Use Batch Apex || Asynchronous Apex || Salesforce

preview_player
Показать описание
PLEASE SUBSCRIBE IF YOU LIKE THE VIDEO
Link of the above video :

link of the module :
Рекомендации по теме
Комментарии
Автор

3.1 LeadProcessor

public class LeadProcessor implements Database.Batchable<sObject> {

public Database.QueryLocator bc) {
// collect the batches of records or objects to be passed to execute
return LeadSource From Lead ]);
}
public void bc, List<Lead> leads){
// process each batch of records
for (Lead Lead : leads) {
lead.LeadSource = 'Dreamforce';
}
update leads;
}
public void bc){
}

}

3.2 LeadProcessorTest

@isTest
public class LeadProcessorTest {

@testSetup
static void setup() {
List<Lead> leads = new List<Lead>();
for(Integer counter=0 ;counter <200;counter++){
Lead lead = new Lead();
lead.FirstName ='FirstName';
lead.LastName ='LastName'+counter;
lead.Company ='demo'+counter;
leads.add(lead);
}
insert leads;
}

@isTest static void test() {
Test.startTest();
LeadProcessor leadProcessor = new LeadProcessor();
Id batchId =
Test.stopTest();
}

}

WonderStudies
Автор

Spin up a new playground and try again if your LeadProcessor code coverage is 0%. I tried this and it worked. Thanks again!

abhishaekchandra
Автор

in test class i got error Method does not exist or incorrect signature: void executeBatch(LeadProcessor) from the type Database

bpr
Автор

i like your videos bro, no time wasting.. straight to the point

Rurouni_Jayanth
Автор

The Apex class doesn't use a QueryLocator in the start method. Make sure you use a QueryLocator in the start method to collect all Lead records in the org.

prkhr
Автор

After running the program the overall code coverage not showing percentage as 100% could you please tell what I have done mistake

shahul
Автор

The 'LeadProcessor' class did not achieve 100% code coverage via your test methods. Make sure that you chose 'Run All' tests in the Developer Console at least once before attempting to verify this challenge.

prabhatkumarsingh
Автор

The 'LeadProcessorTest' test class doesn't use the 'LeadProcessor' class.

showing this error how i can clear this error

durganageshganisetti
Автор

Solution for 100 percent lead processir is save these 2 files multiple time and all multiple times and check for points repeatedly

vatsalsharma
Автор

The 'LeadProcessor' class did not achieve 100% code coverage via your test methods. Make sure that you chose 'Run All' tests in the Developer Console at least once before attempting to verify this challenge.


ila vasthundhi bro

s.rajeshsr
Автор

Class leadprocessor must implement thr method:void ani vasthundhi bro how to correct it

chetana
Автор

Those who are getting 100% code coverage error. Go in validation rules and inactivate the validation rule in Lead Object with error message 'Business can be done with US Leads only'. It will be successful then :)

deepakgidwani
Автор

Guys who are facing “class did not achieve 100% test coverage” error, please check for any Flows if active on Lead object. Deactivate them and the class achieves 100% test coverage.

sarthakmokashi
Автор

Errors em levu sir kani duplicate value found ani vastundhi em cheyali cheppadhi sir

navyasre
Автор

leadProcessor is a legal name ani vostundi broh

sivaChowdary
Автор

EVAREVARIKITEY ERROR VASTUNDO VALLU SAVE CHESI RUN ALL KOTTANDI

dbsrohan
Автор

@wonderstudies why it is showing like insert failed

tippanajothsnaanjinisaiman
Автор

Failed to enqueue tests.: An unknown exception occurred when running the programme so pls remove from this error sir

machupallianilkumar
Автор

illegal name ani vastundhi lead processor

i-ls--sreyagayathrirapet
Автор

The apex class doesn't use a query locator in the start method .make sure you use a QueryLocator in the start method to collect all lead records in the org. Enti bro edhi em cheyali

snehaabhi