Hot answers tagged

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 ...
user avatar
  • 433k
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 ...
user avatar
  • 433k
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 ...
user avatar
  • 48.1k
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 ...
user avatar
  • 433k
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 ...
user avatar
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 ...
user avatar
  • 433k
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. ...
user avatar
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[] { ...
user avatar
  • 433k

Only top scored, non community-wiki answers of a minimum length are eligible