function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sylvain@RibbonFishSylvain@RibbonFish 

AggregateResult and SObject

Hi,

I would like to extract the SObject (not the properties by using ar.get(x)) from an aggregateResult object.

There is no way to do that ?

Like:

 

AggregateResult ar;

Product2 p = ar;

 

(give me this error: Invalid conversion from runtime type SOBJECT:AggregateResult to SOBJECT:Product2)

Thanks

souvik9086souvik9086

No, I'm afraid you cannot make that conversion from Aggregate result to SObject.

 

If the post helps you, throw KUDOS.

Thanks

Sylvain@RibbonFishSylvain@RibbonFish
That's why I tough so ... I have find another solution but thanks i wanted to be sure