A case owner might be a queue, so you cannot use Owner.Manager.Email, but last modified by will always be a user, and hence its allowed to use LastModified.Manager.Email.
List<Case> c = [SELECT Id, CaseNumber, Owner.Email, LastModifiedBy.Manager.Email
FROM Case];
Second Option:-
In the SOQL you can't access the some of the fields via Owner: (Custom fields and some of standard fields)
As we are using an Email-to-Case routing address, it will automatically create a case in your org, from where you can verify the ownership of ...innoutsecretmenu.online (https://innoutsecretmenu.online/)
try with below soql query.
If this helps, Please mark it as best answer.
Thanks!!
Please follow below code:-
First Option:-
A case owner might be a queue, so you cannot use Owner.Manager.Email, but last modified by will always be a user, and hence its allowed to use LastModified.Manager.Email.
Second Option:-
In the SOQL you can't access the some of the fields via Owner: (Custom fields and some of standard fields)
https://skaruz.com/en/2015/03/salesforce-how-to-access-owner-custom-fields-in-a-soql-query/
so better in the case object create the custom formula field with below formula.
Owner:User.Manager.Email
Then you can easily access the above formula field in soql.
otherwise you have to write the custom code to get the manager email.
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh
As we are using an Email-to-Case routing address, it will automatically create a case in your org, from where you can verify the ownership of ...innoutsecretmenu.online (https://innoutsecretmenu.online/)