Timeline for Populating a Map<Id,List<Contact>> for a comparison
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 4, 2019 at 20:35 | comment | added | SatyaV |
You would get another error message as your Line #6 doesn't have any records as you have created lookerByIds at line #3 and didn't assign any values. I would reassess the business need and try to implement step-by-step. This way, we could get more control on the data that is being retrieved. Try going through: Apex documentation.
|
|
Sep 4, 2019 at 19:56 | history | edited | Randy B. | CC BY-SA 4.0 |
added 141 characters in body
|
Sep 4, 2019 at 19:55 | comment | added | Randy B. | The list comes from an external source and contains only the SFDC Account Id and the contact Email. The goal is to compare the emails provided to existing contacts for a given account Id and then create a new contact for it if it does not exist. I have revised it to assign values now but the ID is invalid as I have no contactID to provide it. | |
Sep 4, 2019 at 19:49 | comment | added | SatyaV |
Yes, it would get you 0 as you have initialized lookerByIds at line #3 and haven't assigned any values. Check your business logic to make sure you are comparing a Map/List that contains your Account Ids.
|
|
Sep 4, 2019 at 19:45 | comment | added | Randy B. | Always the small stuff. Seems my if comparison is also off as it returns 0. | |
Sep 4, 2019 at 19:32 | comment | added | SatyaV |
You should be doing lookerByIds.put(con.AccountId, contacts); This should solve your issue.
|
|
Sep 4, 2019 at 19:25 | review | First posts | |||
Sep 5, 2019 at 0:38 | |||||
Sep 4, 2019 at 19:23 | history | asked | Randy B. | CC BY-SA 4.0 |