Timeline for Compile Error: Initial term of field expression must be a concrete SObject: List<User>
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 29, 2015 at 17:37 | comment | added | Aayush K | The reason is the difference in the data type. When you were retrieving using Name, you were defining ToMgrID as a List<User>. Whereas in the suggestion by codeinprogress, the ToMgrID was defined with data type as Id. In your previous code ToMgrID[0].Id would have worked as it would use the first record from the list. | |
Jan 29, 2015 at 17:11 | comment | added | user10727 | yeah i know,but i was unable to figure out why it cant take ToMgrID.Id to assign it to another Id field. But now sorted with the resolution given by codeinprogress. :) bit strange though : as i understand ToMgrID = [select id user where name =:tomgr limit 1]. id is same as ToMgrID = [select id from user where name =: to mgr limit 1] then access Id by ToMgrID.id ,but that dint work :/ | |
Jan 29, 2015 at 16:51 | history | answered | Aayush K | CC BY-SA 3.0 |