1
vote
Apex unit test - Error on ContentDocumentId(Missing field)
This is a common problem
ContentDocumentLink cdl = new ContentDocumentLink(); // HERE
cdl.ContentDocumentId = cv.ContentDocumentId;
insert cdl;
The cv.ContentDocumentId has to be queried for after ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
unit-test × 4498apex × 2792
code-coverage × 769
trigger × 549
failing-tests × 290
class × 201
batch × 189
visualforce × 184
callout × 120
soql × 112
test-setup × 110
controller × 109
deployment × 106
httpcalloutmock × 100
scheduled-apex × 80
community × 57
exception × 54
webservices × 48
rest-api × 47
lightning-web-components × 46
controller-extension × 46
error × 41
future × 41
managed-package × 38
dml × 37