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

How to access LastModifiedDate of Parent from Note object?


I have been trying to access LastModifiedDate of Parent object of a Note record, but ended up with no luck. Here is what I am trying-

Select Id, Title, Parent.Type, Parent.LastModifiedDate from Note

It throws an error-
Select Id, Title, Parent.Type, Parent.LastModifiedDate from Note
ERROR at Row:1:Column:32
No such column 'LastModifiedDate' on entity 'Name'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

Apart from System fields, I am able to access all the parent fields from the same query.
Can anyone suggest if we have any way for this purpose?

Ankit AroraAnkit Arora
Pretty sure we can't access them but not sure the exact reason. You've to query on parent and then you can get those fields.
Grazitti TeamGrazitti Team
Hi Vagish,

You can access last modified field like this but you can fetch ParentId using following query and further query Parent object to get last modified Date.

Select Id, Title, Parent.Type, ParentId from Note

Please mark this solution as best if it helps!

Thanks for your reply, guys. Definitely running two queries will solve the issue. Actually I have been looking for-
1. Can we get the value jsut in 1 query, like we can access other parent fields easily. (now it seems like we can't)
2. If we can't, then what is the reason of this inconsistency?