• Abhisree
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
We have a custom inbound email service that attaches inbound emails as attachments to certain objects. I'm trying to change the code to create a file instead but get an error when trying to create a new ContentDocumentLink to attach the document to the object. Thanks in Advance.

Error: Invalid type:ContentDocumentLink
Error: DML requires SObject or SObject List Type: ContentDocumentLink

I think my content settings are correct.

Code snippet for reference:

else
{
ContentVersion conVer = new ContentVersion();
Long sz;

if(email.subject.length()>80)
{

conVer.Title= email.subject.substring(0,80);
}
else
{

conVer.Title= email.subject;
}
conVer.PathOnClient =conVer.Title+'.pdf';
if(email.plainTextBody == null)
{
conVer.VersionData = blob.valueof(email.htmlBody);
sz = email.htmlBody.length();
}
else
{
conVer.VersionData = blob.valueof(email.plainTextBody);
sz = email.plainTextBody.length();
}
insert conVer;
Id condId=conVer.ContentDocumentId;

ContentDocumentLink cdl = New ContentDocumentLink(LinkedEntityId = book.id, ContentDocumentId = condId, shareType = 'I');
insert cdl;
Does the Code Coverage Rate be for the individual programme or total apex program in the org (include the existing programme)? 

Such as it will summary the code coverage rate for all apex program when I deploy the program to production?

Thanks in Advance
Hi,

Can anyone tell me what is Knowledge User checkbox in User detail screen used for?
I read a document says that : although we enable the Salesforce Knowledge, the Knowledges and Articles Management tabs are not visible. We have to tick the Knowledge User checkbox.
But Tab Visiblility is set up in profile only, not sure why related to Knowledge User checkbox.