function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SPrashantSPrashant 

Uploading Contents using APEX/Visualforce and Attaching to Object record.

Hi,

 

Below is my problem statement:

1. I want to upload files to CRM contents using APEX, to a predefined workspace.

2. After upload, there is a need to attach the content to a particular object record (objects can be Account/ Contact/Opportunity), so that the uploaded content is listed under "Related Content" related List on that records details page layout. Is there any way to do this using APEX code, and what are the Object / Fields I need to update for this using APEX.

 

 

Secondly,

Is there any option available through configuration, so that only certain file types (say, only PDF and doc files) can be uploaded to a workspace, and the user gets an error message that only "PDF and Doc files are permitted to be uploaded" if he tries to upload anyother file type (say, .xls / .xlsx, .ppt / .pptx).

 

Any help is highly appreciated. Thanks in advance.

rosems2rosems2

I am trying to accomplish the very same thing, have you had any luck getting the APEX code to work?