I have two objects Accounts and Invoices. Invoices used to have a lookup relationship to Accounts called "Otter_FFA_Sold_To__c". This relationship was changed to Master relationship. So now, the owner of the invoices will be owner of the account because Account is now the parent.
My question is because due to this change now some queries are failing like this one:
Select Owner.Name c,Invoice_Amount__c from Otter_FFA_Invoice_New__c
I'm getting the error "Didn't understand relationship 'Owner' in field path." I know that it's because of this change. However I don't know which is the best approach to get the owner of the child record in a query.
My query is a little bit more complex than that one but if someone can help how can I achieve this I will appreciate it.
The query that it's failing is this one:
Select Owner.Name c,Sum(Invoice_Amount__c)s from Otter_FFA_Invoice_New__c where (Qad_Entity__c=:ent) and (Otter_FFA_Effective_Date__c >=:CurrentMonthStartDate.toStartOfMonth() and Otter_FFA_Effective_Date__c <=:Effective.Otter_FFA_Effective_Date__c) Group By Owner.Name Limit 500