3 votes
Accepted

Hide related list on Content Document page in experience cloud

These related lists are indeed not found as "common" related list on Content Version page layout to easily remove them via setup configuration. Workaround: under Theme section of Experience ...
user avatar
  • 3,525
2 votes

APEX Class invoked by flow to delete Content Documents, get DML exception on delete "ENTITY_IS_DELETED

ContentDocument may be linked with several cases at ones with contentDocumentLink. Imagine you have ContentDocument1 related to Case1 and Case2. You're iterating through Cases, you are on Case1, ...
user avatar
2 votes

get Actual content from a file from ContentDocumentId

VersionData is a Blob, whether it can be converted to a string depends on the type of file. If it is a text file you can use Blob.toString(). If it is a binary file you can use functions from ...
user avatar
  • 659
2 votes

How to derive a direct link to a file from the link to the download page?

This can be done through ContentDownloadUrl, not to be confused with DistributionPublicUrl. The container URL you see is the DistributionPublicUrl, however the actual file URL can be found in ...
user avatar
  • 2,851
1 vote
Accepted

File corrupted on sending data to create file via workbench using REST API

It's not "corrupted", it's base-64 encoded. In order for it to have a chance of a successful transfer as written, you'd have to use the Content-Transfer-Encoding: base64 header. However, ...
user avatar
  • 439k
1 vote
Accepted

How do I convert a ContentVersion record to JSON to pass via API?

PDF files are not comprised of UTF-8 characters so String myblob = fileBody.toString(); will fail as you noted. You need to use the base64 version of the Blob to get a valid string String ...
user avatar
  • 63k
1 vote
Accepted

How we can convert contentVersion Title to string ,i am getting some type casting error

Welcome to SFSE, and as explained by @TSmith, please follow the guidelines of SFSE in all of the questions. There are multiple best practices missed in the code but to solve the problem refer below. ...
user avatar
  • 417
1 vote

get Actual content from a file from ContentDocumentId

Here is an example you could use for supporting ContentDocuments with FileType TEXT. Storing each ContentDocument and their respective VersionData as a String across a Map. List<String> ...
user avatar
  • 4,769
1 vote
Accepted

How to find enhanced domains enabled in salesforce org via apex?

You can use the DomainCreator class for this. It will return the correct URL in both cases: DomainCreator.getContentHostname()
user avatar
  • 5,258
1 vote

How to get Binary Data to submit to REST API

The binary data must be in its raw form. --boundary_string Content-Type: application/pdf Content-Disposition: form-data; name="VersionData"; filename="10840.pdf" %PDF-rest of ...
user avatar
  • 439k
1 vote

System.StringException Invalid Id

So it turns out Base_Station__c is a lookup, and you are trying to push a String value = csvRowData[0] which is just a string, thus it fails. You need to query the data first and fetch the ID for the ...
user avatar

Only top scored, non community-wiki answers of a minimum length are eligible