New answers tagged

0

SOQL always returns results as a List<SObject>, even if there are no rows to return (in which case, the list would be empty/contain no items). When we expect a single row to be returned, Salesforce allows us to take a bit of a shortcut. Instead of List<Account> accountsList = [SELECT Id FROM Account LIMIT 1]; Account myAcc = accountsList[0]; ...


0

I'm assuming your "objectMap" contains the new object in the key and the old object in the value. You just need to loop through the values and update the old object to not have a value for the lookup. You can add all the updated records (old and new) to the same list to update them all at the same time. //after your first soql query and for loop, go ...


2

You can't really do what you'd want with typical email templates as they can only really display static images that you paste in or references to files that already exist. Since, in this case, the records/files will be created moments before (or be the trigger), it'll need to be able to dynamically pull them when the alert goes out. I can see one of two ...


1

This is addressed by including a controller extension. Create a controller extension, a POTATO (Plain Old Apex Object) Apex class with a signature and constructor of the form: public with sharing class MyExtension { public MyExtension(ApexPages.StandardController stdController) { ... That controller can obtain the contextual object (the contact)...


0

Streaming API seems to match your needs well. From their docs: Streaming API enables streaming of events using push technology and provides a subscription mechanism for receiving events in near real time. Full link: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm I don’t think you can use it to ...


-1

You should try this snippet: schema.getGlobalDescribe().get(SObjectType).getDescribe().fields.getMap().keySet() Also all fields with the hidden one you could get when you execute your code in the scope of some custom Apex Class, in anonymously window you never get those fields.


Top 50 recent answers are included