I have a App__c
with n number of fields.
Page__c
is another custom object has few fields and a field App_Id__c
which is Master-Detail to App__c object.
Field__c
is another custom object has fields and a field Page__Id__c
which is Master-Detail to Page__c object.
I am querying all the Field__c
object records, but the issue I am facing is When I query a record of Field__c
I also need the query to get all fields of the corresponding Grand parent record App__c
.
I know we can get the grand parent record's field like for eg:Name like shown in below query, but I dont want to mention each and every field in the query like this, I want to get all the field values of the grand parent record without having to write each and every field in the query.
List<Field__c> fieldRecords = [Select Id, Name, Page_Id__r.App_Id__r.Name From Field__c];