Questions tagged [contentnote]
The contentnote tag has no usage guidance.
59
questions
2
votes
1answer
32 views
My test class (not annotated seeAllData=true) actually sees data for ContentNote SObject
I know test methods should not see any data except the data created in test context, but when I run the test below, the query returns an org record.
It should not
I have a REST class like
@...
0
votes
0answers
15 views
Creating Trigger for ContgentNote / ContentVersion etc. to capture Content Body?
I'm looking for the best approach to capture the BODY of a Content Note (Content Document) object when one is inserted or updated.
I've enabled the new lightning notes feature in some of my sobject ...
0
votes
2answers
23 views
What is the most performant way to check if Content Notes is enabled in a org?
Is there a more performant way to dynamically detect if Content Notes is enabled?
I see that getGlobalDescribe can be used to check the presence ContentNote, if it present then is enabled. Usually, ...
0
votes
0answers
15 views
Performance of content-based Files/Notes versus the older Attachments/Notes?
We have a Visualforce that supports large numbers of Notes and Attachments (100+) that we have converted to use Content Objects via ContentDocumentLink. But the queries now run much slower.
Are there ...
2
votes
1answer
62 views
Which Storage Limit does a ContentNote count against?
While we can query a ContentNote with SOQL, it does not appear that ContentNote "records" count against Data Storage the way a proper sObject does.
I believe a ContentNote counts towards File Storage ...
3
votes
0answers
64 views
How is the IsReadOnly attribute used on ContentNote?
I'm trying to create a read-only "enhanced note" and I see that there is a property on ContentNote for IsReadOnly which would work perfectly for the use case but unfortunately:
Line: 1, Column: 17
...
1
vote
0answers
28 views
CreatedById Doesnt Work
I am currently developing an external application that uses the Salesforce REST API to consume.
The POST method to the endpoints /services/data/v47.0/sobjects/ContentNote&& /services/data/...
1
vote
1answer
222 views
How do I retrieve and modify AttachedContentNote objects attached to a record?
So I've created a custom object and added the Notes to available related lists on the page layout. Now I want to manage notes through the REST API.
The problem is, I have no idea how to access the ...
1
vote
1answer
55 views
Find all notes which are not related to anything
We imported numerous notes into Salesforce and we were able to connect most of them to their corresponding objects with ContentDocumentLink. However, a few of need to be manually connected. So how can ...
0
votes
0answers
70 views
While converting classic notes to Lightning enhanced Content Notes getting UNSAFE_HTML_CONTENT error on versionData field.!
We are migrating from Classic to Lightning, In this process we are converting classic Notes to Lightning supported Note (ContentVersion).
We have a batch which does this job, getting below error:
...
-2
votes
2answers
147 views
Trying to prevent deletion of a Note with a before delete trigger. Below code is not working [closed]
Please find the below code:
trigger DeleteNote on Note (before delete) {
for(Note N : trigger.old){
if(Trigger.isDelete){
N.adderror('Note Cannot be deleted');
}
...
0
votes
1answer
100 views
Notes. Mass Upload. Hitting some limit and getting “Note can't be saved”
I'm doing data migration and need to upload ~500k Notes. 192k Notes were uploaded and now I'm getting Note can't be saved error via API and Note contains characters that can't be saved when trying to ...
0
votes
1answer
183 views
After adding 500 ContentNote objects to one Account by one user, nobody can add any more ContentNote records
We are developing a ContentNote integration piece.
As a System Administrator of a Partner Developer org (note: NOT the usual Dev org, although i don't know if this matters, the PD has higher limits ...
0
votes
2answers
2k views
How to fetch contentNote records as per the contact record?
I am trying to fetch the note title, note body as per the related contact ID in one SOQL query as two SOQL queries won't serve the purpose.
In contentNote, We have the note title and note body but ...
2
votes
2answers
397 views
ContentNote - INVALID_INPUT which characters are invalid
I am trying to use REST API to update the content of ContentNote object.
I am submitting base64 encoded content, e.g. this:
PHA+cmFiYml0PC9wPjxwPjxicj48L3A+PHA+...
0
votes
0answers
53 views
Download ContentNotes linked to entities by others
I have an org with SNotes enabled.
I am trying to use REST API to query SNotes on Account. If the current user adds an SNOTE, then a simple SOQL query like so returns it:
GET /services/data/v42.0/...
1
vote
2answers
1k views
“Note can't be saved” error on ContentNote insert
I'm trying to create ContentNote records from Note ones but it's always giving me this particular error:
FATAL_ERROR System.UnexpectedException: Note can't be saved
Code:
List<Note> noteLIST ...
0
votes
2answers
456 views
How to export the Data from the ContentNote Object in the Salesforce Professional Edition
I have exported all the data from the Professional edition Salesforce Org. However I have all the data from the available objects, but the data of the Salesforce Internal object 'ContentNote' is ...
2
votes
2answers
157 views
Custom exception on Enhanced Notes
I need to write a trigger on a Enhanced Notes ( which are stored as ContentNote records ).
I need to match a certain text in the note body and then show the custom exception on the note component ...
6
votes
2answers
90 views
Workaround for the one record at a time trigger invocation when starting from Content Note
I hit this platform problem a while ago Why is this ContentNote trigger receiving 1 record at a time even though multiple records are being inserted?. But today I've hit it again and now I need a ...
1
vote
2answers
649 views
Content Notes from CSV not uploading via Data Loader
We are attempting to upload a CSV containing local drive links to text files and html files. We want these to become "Content Notes". Data Loader keeps throwing errors when we attempt to upload (see ...
4
votes
1answer
340 views
Why is this ContentNote trigger receiving 1 record at a time even though multiple records are being inserted?
I am seeing a ContentNote trigger called on individual rows even though a bulk insert is done. A stripped down version follows.
The debug log output demonstrates that 3 ContentNote objects are ...
3
votes
0answers
727 views
Why do I get the error “System.VisualforceException: Read access denied for ContentNote, controller action methods may not execute.”?
In a Visualforce page I am outputting fields of ContentNote (such as "CreatedDate") using the same pattern that already works for Note (and many other types) where the sob is a reference to the ...
2
votes
1answer
567 views
“Unable to create/update fields: VersionData” error when updating a ContentNote from Apex
I have some Apex code that inserts a ContentNote and the corresponding ContentDocumentLink. This works fine and the data can be viewed through the normal Salesforce UI.
But some further code that ...
6
votes
0answers
174 views
How to detect a size change for a ContentDocument or a ContentNote in a trigger?
Both ContentDocument and ContentVersion have a ContentSize field documented to be:
Size of the document in bytes
but after adding debug code to check that field for both types for these events:
...
9
votes
1answer
875 views
How to distinguish between ContentDocument and ContentNote?
There seems to be some unusual stuff going on with SObjectType for the enhanced note ContentNote (ERD) object and the underling ContentDocument (ERD) structure.
For example, both these return a ...
1
vote
0answers
129 views
Translate IsPrivate check into Enhanced Notes
I am migrating notes into Enhanced Notes, How do I move the IsPrivate(Checkbox on Notes) values into Enhanced Notes?
If the IsPrivate Checkbox is checked on Notes, how can I do this on EnhancedNotes?
4
votes
1answer
408 views
Why is this ContentNote test failing?
The assertion in this test - a stripped down version of a bigger to illustrate the specific problem - that has the comment:
// This assertion fails: 'Hello' is returned not 'World'
fails:
@IsTest
...
1
vote
1answer
1k views
Trigger on Notes (lightning)
Requirement: If a note is added to either an account, contact, opportunity, task and event for particular record types and the current user is not an administrator and not a user mentioned in system ...
0
votes
1answer
131 views
Problem in Covert ( image,line break,Numbers) from blob into string on Visualforce page
I have written a code to convert the blob content into string to display it on Visulaforce page.Its working.But I couldn't able to show the image.I mage is also converted as string like :
<img
src=...
5
votes
0answers
101 views
Impossible to navigate to a related contentNote in custom Lightning component
I'm building a 'simple' component that displays a list of notes related to a collaborationGroup. Basic functionality works. I am unable to make the note title into a link, and just discovered tha ...
-4
votes
1answer
893 views
How to escape html characters in long text area field
I have a requirement where i need to copy the contents of a contentnote to a longtextarea field called 'comments' using apex anonymous.
The issue is i am getting the following HTML characters
for ...
0
votes
1answer
403 views
ContentNote not showing correctly
I'm linking a ContentNote to a Lead object, but the notes that i've been making are showing symbols like "��br��z{^�Ʃx{f" instead of what is provided in the post call to the api.
Any ideas on why ...
0
votes
0answers
69 views
How to restrict specific profiles to create note
I need to restrict users with a specific profile to create Note in Salesforce for under lead object. I know that Note object will inherit access level from parent Lead.
I need lead to be accessible ...
1
vote
1answer
88 views
Creation of ContentNotes in Apex suddenly failing with System.UnexpectedException: Note can't be saved error
I have some batch code that creates ContentNotes in Apex. It was working perfectly well until all of a sudden last night it stopped working without any code changes whatsoever. It is now throwing the ...
1
vote
0answers
285 views
How to show error msg in ContentNote?
I want to show error msg whenever notes get created without attaching to any records. As trigger on ContentNote is not available I've written Trigger on ContentDocumentLink, but I am not able to show ...
0
votes
1answer
307 views
Prevent deletion of ContentNote
Is there anyway to prevent a user from deleting a New Note, based on the status of the Opportunity that the contentnote is linked to?
The requirement is that I have a datetime field that is set, once ...
1
vote
1answer
58 views
How to check ContentNote settings
I am working on managed package, it works fine and everybody is happy. In latest version I've added one trigger that works with ContentNote sObject.
Issue is that when I try to install it to the ...
1
vote
3answers
8k views
ContentDocumentLink insertion fails
I want to share all records with admin user using next trigger:
trigger ContentVersionTrigger on ContentVersion (after insert) {
system.debug('sdfsdf' + Trigger.new);
for (ContentVersion ...
1
vote
2answers
309 views
Assigning owner to ContentNotes
I am trying to assign the OwnerId to ContentNote (Notes) using Data Loader on new inserts, however I get the following error:
Documents in a user's private library must always be owned by that user....
18
votes
1answer
2k views
Lightning Components: how to invoke “New Note” panel from custom components?
On the Standard-Related-List "Notes" there is a New Button. This New Button opens a Panel on the bottom of the screen like this:
How can I invoke the opening of this "New Note" Panel? I've tried so ...
0
votes
1answer
272 views
E-Mail Body to ContentNote. Note can't be saved because it contains HTML tags
16:11:34:630 USER_DEBUG [25]|DEBUG|<div dir="ltr"><br><div class="gmail_quote">---------- Weitergeleitete Nachricht ----------<br>Von: <b class="...
2
votes
1answer
434 views
Linebreaks in Flows to populate body of contentNote
I have a flow that populates the content of a ContentNote record. i use a formula that combines values from various variables in the flow and concatenate it.This concatenated text is displayed in the ...
0
votes
1answer
820 views
Not able to retrieve Notes(ContentNote Object) in Account
When i tried to pull "ContentNote" i was getting the below exception.
INVALID_TYPE: sObject type 'ContentNote' is not supported. If you are attempting to use a custom object, be sure to append the '...
0
votes
1answer
168 views
Batch Apex creating Multiple contentdocumentlinks when trying to “convert” tasks to notes…
I am trying to look at all tasks for a specific time frame, then create a note and set the LinkedEntityId to the whatid or whoid. This code creates the content note, 1 for each task. But then created ...
0
votes
2answers
177 views
Trigger error : create a note
I'm writting a trigger that have to create a new note (ContentNote) when a field is filled (toNote__c ).
The trigger had to occurs when the record is updated.
Here is the trigger :
trigger ...
2
votes
1answer
95 views
How to use Sfdc.ChatterNotes.createNote() in my visualforce page to add a Note to my custom object?
I'm trying to have a button in my VFP that'll add a Note (AttachedContentNote) to my custom object.
I want my button to do the same as the New Note button from the Note's relatedList in my custom ...
4
votes
1answer
750 views
Why are no results returned when performing a SOSL query on ContentNote in a Test Method?
Following the example laid out in Adding SOSL Queries to Unit Tests, I created a test method that inserts a ContentNote record, sets the results using Test.setFixedSearchResults(), and then performs a ...
0
votes
1answer
171 views
Data load to ContentNote Object using any tool (Informatica Cloud or DataLoader)
I found the below link (another question) - this does not seem to be a correct answer and am urgently looking for a solution for the same.
ContentNote with related Object
After loading the ...
2
votes
1answer
3k views
New Notes (ContentNote) Note Sharing Settings via Trigger
Is it possible to manipulate note sharing settings in a trigger? (after insert) I wanted to set a default specific set of users whenever a new note is created. I've tried searching everywhere to no ...