Hot answers tagged

2

I have found a better way to accomplish this all in a single call by utilizing REST API. You use the endpoint automation/v1/automations to create (POST) your new automation. See below example: POST /automation/v1/automations Host: {{yourSubDomain}}.rest.marketingcloudapis.com Authorization: Bearer XXXXXXX Content-Type: application/json and then the ...


1

Database.convertLead is going to create a new contact, unless you modify the LeadConvert object to use an existing contact Id. See here https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dml_convertLead.htm setContactId(Id) Sets the ID of the contact into which the lead will be merged (this contact must be associated with ...


1

Your code won't work in bulk (try using the Apex Data Loader to insert two or more opportunities on two or more accounts at once). In addition, you have a lot of redundant code by implementing a naive trigger handler class, and you have a lot of waste in your queries by not using an aggregate query call. All that aside, the answer to your original question ...


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