0

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 on storage, api calls and users), i added 500 ContentNote objects using Execute Anonymous Apex from developer console by running the following snippet a couple of times:

List<ContentNote> notes = new List<ContentNote>();
List<ContentDocumentLink> l = new List<ContentDocumentLink>();
for (Integer i = 200; i < 500; i++) {
    ContentNote cn = new ContentNote(Title='test ' + i, Content=Blob.valueOf('banana'));
    notes.add(cn);
}

insert notes;

for (ContentNote cn : notes) {
    ContentDocumentLink cl = new ContentDocumentLink(ContentDocumentId = cn.Id, LinkedEntityId = 'SomeAccountId', ShareType = 'I');
    l.add(cl);
}

insert l;

Further runs of this snippet failed with a the following error:

Note can't be saved

After this, no user in the org is able to add any ContentNotes from the UI or Apex (UI displays:

Note contains characters that can't be saved

even if note says test), even the Unit Tests fail.

I tried switching to a different IP address to no avail. There is plenty free storage and data storage.

I have deleted the 500 notes i added, but i am still unable to add more ContentNote objects.

Any suggestions?

2

You will get this error message when you have hit the limit. Salesforce allows limited number of content version that can be added to org in every 24 hours.

Environment Type    Default Maximum
Production          200,000 500,000
Sandbox             36,000  500,000
Developer Edition   2,500   2,500
Trial Environments  2,500   2,500

You can raise a case with Salesforce to increase it.

Read more here:- Increase the Maximum number of 'Content Versions' published per day

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.