If you have encountered this error while working on Triggers. This is because once you are in an after insert/update trigger and the records are read only in that context as they have been written, but not committed, to the database. Unfortunately your trigger is relying on the ids of the records, which means you …
Category: Salesforce
Salesforce Related
Permanent link to this article: https://salesforcebuddy.com/2019/01/record-is-read-only-trying-to-update-in-after-insert-trigger/
Jan 24
Salesforce – Spanning Relationships
Each Object in Salesforce is allowed to have upto 15 unique relationships with other objects. Objects can be related to other objects using a relationship field. When objects are related to each other, user can create formulas that reference fields on the other object. For instance: You have a custom object called MyObject1 You have …
Permanent link to this article: https://salesforcebuddy.com/2019/01/salesforce-spanning-relationships/
Jan 24
Apex : Throwing Custom Exceptions
There will be scenarios when you want to throw an exception from your catch block, may be to propagate to the invoking class so it is handled properly. Below is a Custom Exception class which can be used to throw different types of exceptions as needed. public with sharing class CustomExceptions { public class InputDataException …
Permanent link to this article: https://salesforcebuddy.com/2019/01/apex-throwing-custom-exceptions/