We’re rewarding the question askers & reputations are being recalculated! Read more.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2
votes
1answer
865 views

Is it possible to cast an sObject to another object that is dynamic?

I'm having a problem with my code because I need to get a list of records of a dynamic type, and that is working alright, but then I need to use some of the fields and can't reach them, giving me the ...
2
votes
2answers
511 views

Dynamic method to take in a list of sObjects, cast and loop through them and perform field logic?

We currently have 2 different classes of code doing essentially the same thing on both the lead and account objects- grab the country and postal code and assign a territory. We are looking to combine ...
5
votes
1answer
13k views

Error: Invalid conversion from runtime type List<ANY> to List<Map<String,ANY>>

This seems similar to other "Can not cast List to List" questions, except in the other cases the culprit tended to be custom sObjects, whereas nothing like that is relevant here. Why is this cast ...
3
votes
1answer
2k views

Convert Map to List using SObject field values

I have a Map of Financial__c records, stored like so: Map<Id, Financial__c> idWithParent = new Map<Id, Financial__c>(); The Id part belongs to a different objects record, like a service ...
1
vote
1answer
584 views

How to sort a custom list of Notes and Attachments by LastModifiedDate

In my VF Page I have been asked to show a list of all the Notes and Attachments in one table, and sorted by the common LastModifiedDate ... So I have a wrapper class in my custom controller: public ...