Posted on May 30, 2026 Leave a Comment
The clearOutRecords would iterate all the fields passed as the currentRecord, then: 1. Exclude the fields as part of the fieldsToExcludeForClearOut Set and relationship fields 2. Check if the field is not null and updateable 3. Special logic to set fields to predefined values 4. Set all other fields to null 5. Return the SObject […]
Posted on February 8, 2026 2 Comments
There are different ways you can use salesforce to attach a file to an SObject using Chatter. Apex Code Chatter REST Api Some limitations using this is using Blob for version.VersionData = attachment.Body; will run into Apex String length exceeds maximum: 6000000. Chatter Rest API POST https://cs43.salesforce.com/services/data/v35.0/connect/communities/0DB63000000003jGAA/chatter/feed-elements/batch HEADER Authorization Bearer {sessionToken} Content-Type […]
Posted on January 4, 2026 Leave a Comment
When you are writing Apex code you want to minimize the amount of SOQL queries in your code. One of the ways todo this is to create an SObject with some information of that object. Let us say you have the following SOQL query: Contact getAccountId = [Select AccountId from Contact limit 1]; Now you […]