Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

3 votes
Accepted

How to avoid nested for loop condition for code optimization & reusability?

tl;dr Nested loops are fine in some contexts. Here, you may want to enumerate all the fields that are in violation, so the user doesn't have to keep edit/save cycles, or even worse, discard all their ...
user avatar
  • 430k
2 votes

Triggers on contact to update decsiption field of its parent account

You have queries and DML operations in a loop, both of which are bad. Also, you're querying the records only in the trigger, which would cause the overwriting you've observed. Instead, you'll want to ...
user avatar
  • 430k
1 vote

How to assign a value to to a field stored in a custom setting?

When you have a string that holds a field name, you need to use SObject's .set() and .get() instead of the normal dot-notation. c.set(settings.Field__c, 'test');
user avatar
  • 47k
1 vote

System.LimitException: Too many callouts: 101 Error

The error message is clear that you cannot make more than 100 calls in Transaction (Tx) context. Each time your future job runs, it starts a new Tx context and that execution can make max 100 calls. ...
user avatar
  • 1,550
1 vote

I am trying to split logic from Trigger to handler class with "Method does not exist or incorrect signature: void Error

Your trigger is invoking the handler method like: OpportunityHandler.handlerAfterDelete(Trigger.old); This is fine when the handlerAfterDelete method is static, but it is not. You should ensure you ...
user avatar
  • 26.7k

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