As part of the Winter 16 release, in addition to the lightning experience Salesforce rolled out some new Notes. I enabled the new notes, however we are keeping salesforce classic experience for now. I was hoping to get some help on the following questions. These are in the "Notes" list on the relevant pages (Lead, Contact, Account, Opportunity). I went ahead and hide the old Notes and Attachments section, and added the Notes to the layout. They are stored as ContentDocument object.
I had a few questions:
How can I ensure these notes are being associated to the Account/Contact during a lead conversion event. I see this happening sometimes but not others, in fact I can view the note browsed to via the Files section of a Chatter User page, that its associated to a Lead but when I click that lead it mentions "Lead Converted".
How can I query these using SOQL?
When I go into Developer Console and execute these queries:
SELECT COUNT(Id) FROM ContentDocument -> yields 3
SELECT COUNT(Id) FROM ContentDocument WHERE Id != '069o0000000HQVm' > yields 3
SELECT COUNT(Id) FROM ContentDocument WHERE Id = '069o0000000HQVm' > yields 1
I think this is related to some type of permission issue. If I explicitly share a note via the UI with myself (I am a SysAdmin but not Note Creator) I can query the note via SOQL however if I don't have permission I can't. Perhaps the solution is to create a default sharing permission.
SELECT Id from ContentDocument
?!=
operator? Does '069o0000000HQVm' only come back if you explicitly search for it.Sharing
with the lowest cost then it will only bring back results based on the sharing rules. The explicit query with the Id would bypass that and bring back the actual record.