Timeline for map parent Id to all its child records ( getting Error: Incompatible value type )
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 5, 2016 at 6:10 | history | edited | Ratan Paul | CC BY-SA 3.0 |
edited title
|
May 5, 2016 at 6:03 | vote | accept | Testing_SFDC | ||
May 5, 2016 at 5:59 | comment | added | Mr.Frodo |
Well for list there is no method values().your first for loop must be like this: for(Survey_Question_vod__c sq: oldques
|
|
May 5, 2016 at 5:56 | comment | added | ajinkyah | @SFDC_Learner Can you tell us what exactly you want to store in the map? | |
May 5, 2016 at 5:54 | comment | added | ajinkyah | @SFDC_Learner oldques is a list but you want to store each record from the list in the map, so each record will be a value and record id will be the key. | |
May 5, 2016 at 5:54 | comment | added | Testing_SFDC | Please find the updated snippet. | |
May 5, 2016 at 5:53 | history | edited | Testing_SFDC | CC BY-SA 3.0 |
added 551 characters in body
|
May 5, 2016 at 5:53 | comment | added | Adrian Larson♦ | Do you want a list or single record as the value? | |
May 5, 2016 at 5:52 | comment | added | Testing_SFDC | But oldques is a list of Survey_Question_vod__c. It throws now this error - Method does not exist or incorrect signature: [List<Survey_Question_vod__c>].values() | |
May 5, 2016 at 5:51 | answer | added | Ratan Paul | timeline score: 2 | |
May 5, 2016 at 5:49 | comment | added | Ratan Paul |
you map should be Map<Id,Survey_Question_vod__c> and iterate over oldques.values()
|
|
May 5, 2016 at 5:48 | history | edited | Ratan Paul | CC BY-SA 3.0 |
deleted 4 characters in body
|
May 5, 2016 at 5:47 | history | asked | Testing_SFDC | CC BY-SA 3.0 |