Hot answers tagged

3

There's no way to do this without installing some component of yours within the page on the front end, to listen for the message broadcast by your trigger and display it to the user. You'd have to place a custom Lightning component, or embedded Visualforce page, on the standard layout or in an overridden Lightning Record Page. Then, that component would ...


3

The main difference between them is "context". A Queueable (or a @future) is called by the developer. It can be called in any operation (trigger, visualforce, flow, schedule, Aura/LWC, etc), but we have a limit on the number of queueable jobs we can schedule in a single transaction (50 in the original transaction, 1 if you are already in a future context). ...


2

welcome to the site. The standard way to do this would be to populate a map of Id to Specification__c, i.e.: Map<String, Specification__c> specMap = new Map<String, Specification__c>(); List<Specification__c> OfferSpecs =[Select id ,Name,Level__c,Offer__Id__c from Specification__c where Offer__Id__c IN : OfferIds ]; for(Specification__c ...


2

You need to use the "aggregate-query-update" (my blog post) pattern to get parent record information. Basically, you aggregate the values to query from the database, query the database, then perform any updates. We can also optimize this by using a simple Set to determine if the case matches; we'll filter by a query filter to reduce the number of records we ...


2

You are getting this error because of the below line Case tempCase = item.SF_CaseID__c != null ? casesById.get(item.SF_CaseID__c) : casesById.get(item.SF_ApplicationID__c); In the above line if casesById map doesn't have a matching key, it will return null and hence your tempCase will be null. And if you try to access the attributes of the null variable, ...


1

So it turns out Process Builder was running actions when the Account record was changed so I had to put a flag on the Account record, which is updated to true the moment a batch job is created. This ensures only one batch is created for a given transaction. The code change is below for the AccountHelper class /** * Helper class for Account trigger handlers *...


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