8
votes
Accepted
Salesforce Flow Limitations - Loop vs Batch Records
What is the difference between a transaction and interview?
A transaction is one complete execution unit as far as the server is concerned. I've always explained it as this: one debug log equals one ...
3
votes
Accepted
Batch Apex: class executed multiple times at once?
By default, Batchable Apex processes the results from the start method in batches of 200. Presuming you're saying that you create one campaign in the execute method, then you would indeed have five ...
3
votes
Add value to multi-select picklist with batch class
In a nutshell, DML on one object does not cause changes made to related data to be saved.
You need to be performing DML on a Placement__c (I'm assuming that's what the SObject name is) record, not the ...
2
votes
Batch class run after press button
You have the following options available in Salesforce:
Quick Action that uses an Aura or Lightning Web Component
Can be with a modal (LWC/Aura) or headless (LWC/Aura)
Object-Specific Quick Action ...
2
votes
Apex passing parameters to Batch job during scheduling
You can pass parameters to batch class when instantiating it, for example
String query = 'SELECT Id FROM Account';
SomeBatchClass batch = new SomeBatchClass(query);
Database.executeBatch(batch);
and ...
1
vote
Variable does not exist: Apex Batch
PBE.Price_Book_2__c=PBE.Pricebook2Id;
Fails because there aren't any such properties in your class. Further the final modifier will prevent you from assigning the query value. global is not advised ...
1
vote
Getting content from within triggers is currently not supported
Explanation:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
When chaining jobs with System.enqueueJob, you can add only one job from an executing job. ...
1
vote
Accepted
Change the format of all Contacts phone numbers to 1234567891
The Salesforce UI automatically formats numbers this way, so you'll want a trigger:
trigger FixNumbers on Contact (before insert, before update) {
sObjectField[] phoneFields = new sObjectField[] {
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
batch × 1865apex × 1283
schedulebatch × 238
scheduled-apex × 217
unit-test × 189
soql × 128
trigger × 125
governorlimits × 90
callout × 87
future × 52
code-coverage × 51
asynchronous × 48
visualforce × 44
class × 41
query × 36
email × 32
rest-api × 30
error × 29
dml × 29
exception × 27
stateful × 27
scheduled-job × 25
limits × 24
querylocator × 23
singleemailmessage × 21