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
Michał Bajdek 28Michał Bajdek 28 

database.query does not select relations

I have to write a generic method for retrieving objects in the many to many relation. The problem occurs when writing SOQL gets a complete dataset :
User-added image
and in case of Database.query it doesn't get any relations as a result.
User-added imageI can't use soql because the component is supposed to be generic. What do I have to do to get all fields?
Naga  AlapatiNaga Alapati
Hi Michal,

You can use getSObject() method to get the field values that you need as shown in the below screenshot

User-added image


Regards,
Naga