Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
389 views

ContentPublication Limit exceeded in Test Class?

Is the content publication limit applicable to test class as well? All i am doing on my test class is to create a contentversion record. It still says that ContentPublication Limit exceeded. Does ...
Prady's user avatar
  • 12.4k
1 vote
2 answers
4k views

How to have NetworkId (Community Id) logic working in both production and unit tests?

Some existing product code that creates ContentVersion instances is now being called from a community and the code fails with: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do not have the level ...
Keith C's user avatar
  • 137k
1 vote
0 answers
1k views

Inserting Content Version via Community User in test class Failing

I think this is very straight forward I just can't figure out the issue behind it. Error: : Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, You do ...
Snorlax's user avatar
  • 47
2 votes
1 answer
1k views

Test Class for ContentDocumentLink causing Internal Salesforce Error

I have a test class that is inserting a ContentDocumentLink between a ContentNote (SNOTE) and a custom object. Everytime I try the insert it causes an Internal Salesforce Error. I have absolutely ...
ScottH7a9's user avatar
  • 585
0 votes
2 answers
833 views

Unable to access versionData from test class

I am facing an issue but I don't know what I'm doing wrong. I'm writing a test class for a code which has this 2 lines: public static Blob getPkpass(){ // more code here... List<...
Javier's user avatar
  • 33
2 votes
1 answer
3k views

Field not writable: ContentVersion.FileType

In the following test method: static testMethod void testEmailWithAttachments() { ContentVersion contentVersion = new ContentVersion(); contentVersion.FileType = 'Text'; ...
sfdcadmdev's user avatar
6 votes
2 answers
6k views

ContentVersion FileExtension

Does anyone know how I can change the FileExtension for a new ContentVersion in a test class? Im currently trying to create a test class for my ContentDocumentLink Trigger, in which I have an if ...
Tim Werner's user avatar
1 vote
1 answer
45 views

What kind of test can I write to check the file?

I have a controller for VF Page. This code upload a profile's image (we can see it after that) and delete it. What kind of test can help me to check this file? I need to know, is it uploaded or not. ...
user60684's user avatar
  • 163
0 votes
2 answers
1k views

Make the test work: File insert, check this File

This code is a controller for my VF Page. It inserts ContentVersion and ContentDocumentLink. After that a candidate field Photo__c take a ContentVersion.Id value. How to check it correctly? Now ...
MichaelLev19's user avatar
2 votes
2 answers
2k views

Specify ContentSize when creating new ContentVersion in UnitTest

I used the post: Test class for contentdocumentlink as a model, however, when I attempt to define my own ContentSize for the ContentVersion document I receive: Field is not writable: ContentVersion....
Jared Luellen's user avatar
5 votes
0 answers
2k views

ContentPublication Limit exceeded in Unit Test

I have Apex triggers on ContentDocument and ContentDocumentLink Sobject. I wrote my Apex Unit Tests for those triggers and I was creating more then one Content Data record to test the Logic in Bulk. ...
MarcoDev's user avatar
  • 181