Hot answers tagged

4

Sure, but let's get the trigger bulkified first. I'd strongly recommend completing Bulk Apex Triggers on Trailhead. The quick summary is that here we need those SOQL queries out of the loop, and you can combine them into a single parent-child SOQL query at the top. You don't need to query the records in Trigger.new at all (you get their data for free), but ...


3

To check the list empty value, You can use these methods from List class:- isEmpty() Returns true if the list has zero elements. Example:- !opportunitiesMap.get(actualTool.Rent__r.Opportunity__c).OpportunityInfo__r.isEmpty() size() Returns the number of elements in the list. Example:- List<Integer> myList = new List<Integer>(); Integer ...


2

I don't know of anything out-of-the-box Apex that will do that kind of filtering. A sample helper method in Apex would look like this: public Set<String> filterStartsWith(Set<String> fields, String filter) { Set<String> filtered = new Set<String>(); for (String field : fields) if (field.startsWith(filter)) ...


2

Each of these two approaches below should work: buildingIds.add((String)buildingAttributes.get(attributeName)); Or buildingIds.add(buildingAttributes.get(attributeName).toString()); The problem is you try to add an Object into a Set of string.


1

Pretty obviously this is not okay, and in order to allow the maps go to Setup > CSP Trusted Sites > New Enter the following in the url: https://*.forceusercontent.com Name it however you like, with an end result of something like this: Trusted_Site_Name community_lightning_maps Trusted_Site_URL https://*.forceusercontent.com Active Checked Context ...


1

You have to build the map in JS as an object: let jsMap = { '0017F00000gqDetQAE': { 'ACCOUNTNUMBER': 'CD451796 -- new', 'PHONE': '(512) 757-6000 --' }, '0017F00000gqDevQAE': { 'NAME': 'Pyramid Construction Inc. --' } }; let stringForSendingToAPEX = JSON.stringify(jsMap); Then you will be able to deserialize this ...


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