Please note Orgs with Enhanced Notes active do not create Note records, which represents classic Notes.
Instead, they create ContentNote records, which are part of a much more complex ERD. ContentNote doesn't have a ParentId field (its relationship to records is many-to-many), so your trigger would have to be on the ContentDocumentLink object.
ContentNote is basically a facade on the underlying ContentDocument and ContentVersion objects, but you can identify the note records by the FileType field: All notes have a file type of SNOTE.
Be aware that ContentDocumentLink is used for linking all Content records (not just notes) to sObjects, and that there are unique restrictions on querying it that are described in the documentation linked above.
Get more detail about this object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Please note Orgs with Enhanced Notes active do not create Note records, which represents classic Notes.
Instead, they create ContentNote records, which are part of a much more complex ERD. ContentNote doesn't have a ParentId field (its relationship to records is many-to-many), so your trigger would have to be on the ContentDocumentLink object.
ContentNote is basically a facade on the underlying ContentDocument and ContentVersion objects, but you can identify the note records by the FileType field: All notes have a file type of SNOTE.
Be aware that ContentDocumentLink is used for linking all Content records (not just notes) to sObjects, and that there are unique restrictions on querying it that are described in the documentation linked above.
Get more detail about this object: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Please note Orgs with Enhanced Notes active do not create Note records, which represents classic Notes.
Instead, they create ContentNote records, which are part of a much more complex ERD. ContentNote doesn't have a ParentId field (its relationship to records is many-to-many), so your trigger would have to be on the ContentDocumentLink object.
ContentNote is basically a facade on the underlying ContentDocument and ContentVersion objects, but you can identify the note records by the FileType field:
All notes have a file type of SNOTE.
Be aware that ContentDocumentLink is used for linking all Content records (not just notes) to sObjects, and that there are unique restrictions on querying it that are described in the documentation linked above.
Get more detail about this object:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.
All Answers
Please note Orgs with Enhanced Notes active do not create Note records, which represents classic Notes.
Instead, they create ContentNote records, which are part of a much more complex ERD. ContentNote doesn't have a ParentId field (its relationship to records is many-to-many), so your trigger would have to be on the ContentDocumentLink object.
ContentNote is basically a facade on the underlying ContentDocument and ContentVersion objects, but you can identify the note records by the FileType field:
All notes have a file type of SNOTE.
Be aware that ContentDocumentLink is used for linking all Content records (not just notes) to sObjects, and that there are unique restrictions on querying it that are described in the documentation linked above.
Get more detail about this object:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_contentnote.htm
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.