New answers tagged

1

While not clear from the paraphrsaed code, the issue here is one of case sensitivity. Map keys (and values stored in Sets) are case sensitive. Given this map Map<String, Integer> myMap = new Map<String, Integer>{'keyval1' => 1}; myMap.get('Keyval1') would return null because "Keyval1" != "keyval1" in this specific context. ...


1

One other suggestion I'd add is that if you are mapping fields, you can Custom Metadata to make that more flexible. You can create a new MD object to store the mappings, and then have fields that store the source object\Field and a target object\field. When you use Entity Lookups, selecting the object will then show all the available fields on each object, ...


1

This feels silly to ask, but did you actually assign the permission set to the user? I've made the mistake where I created it but never assigned it. Finally, the data loader gets all the settings when you do the login at the start, not when you're making the insert. So if you logged in -> added permission -> went to insert then the fields wouldn't be ...


3

Yep, using a map is the way to go here. Any time that you find yourself doing something like this for(item1 :collection 1){ for(item2 :collection 2){ if(item1.MyField__c == item2.MyField__c){ // do things to get data from one record to the other } } } then you should stop and think about using a map instead. A map is just ...


0

I think you already know this but I'm just laying it out there that it is not advisable to use nested for loops. Like you said you can use map to compare these two lists. Map<key, value> uses a key value format so you can take the common identifier for the two lists which is opportunity as a key in map to compare. So your code looks like List<...


3

The compiler is expecting a list of accounts for the below for loop, but it is account. Account acclst = accMap.get('00O28000004oRjdEAE'); for(Account a: acclst){ } So the map should be Map<Id, List<Account>>, use the below code to put the values into the map. Map<Id, List<Account>> accMap = new Map<Id, List<Account>...


0

Stack depth exceeded indicates an infinite recursive call. This might happen because the attribute is passed back and forth between parent and child infinitely for some reason. You may need a second attribute to fix this. I think you also need to use a change handler, instead: <aura:attribute name="mapValues" type="Object" /> <...


1

That's expected. When you try to print out a javascript object on the page you'd get [object Object] - https://www.w3schools.com/js/js_object_display.asp Your map is most likely reaching the lightning component. Did you check the console.log output in the browser ? Please put the output here for more clarity. If all is well, you should be able to see the Map ...


1

This shall work perfectly with above method. @isTest private static void testSendMail(){ List<Map<Object, Object>> jsonMap = new List<Map<Object, Object>>(); Map<Object, Object> tempMap = new Map<Object, Object>(); tempMap.put('title' , 'Title1'); tempMap.put('link' , 'https://www....


1

Just use get method as you would on SObject. AggregateResult aggregateRecord = aggregates.get(...); Date aggregateValue = (Date)aggregateRecord.get('dateMax'); If you hadn't given the field an alias, it would instead be .get('expr0').


Top 50 recent answers are included