• swati-srivastava
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Hello i have published a file in workspace. Now i want to attach this file as an attachment to opportunity from my custom controller class. I can also formulate the url of that document using ContentDocument doc = [SELECT id FROM ContentDocument WHERE title = 'hello']; String fullFileURL = URL.getSalesforceBaseUrl().toExternalForm() + '/' + doc.id; System.debug(fullFileURL); Can anybody please tell me how can i do that.
Hello all, I need to get a list of all workspaces(libraries) supported and populate them into a dropdown. Selecting any particular workspace will allow to publish any record to that particular workspace. Any help is appreciated. :)
Hello all, I need to get a list of all workspaces(libraries) supported and populate them into a dropdown. Selecting any particular workspace will allow to publish any record to that particular workspace. Any help is appreciated. :)

Hi Everyone.

 

Do you have idea about how to associate a salesforce content doc with a custom object record using Apex? I have done ths using standared functionlity with follwing steps -

 

1. Add "Related Content" related list to the pagelayout of selected custom object

2. Click on the  "Search All" button. It will redirec to the Conent tab (With list of all shared content docs/images/videos)

3. Select particular content doc and click on the "Attach" link besides the selected content.

 

Content will be associated with the selected record and will be displayed in "Related Content" related list.

But i dont understand how this association is handled in backend (database point of view). I did not find any relational fields in ContentDocument or ContentVersion object using them we can establish this relationship.

 

How to create this mapping between object record and sfdc conten?

What is  the use of parameters "eid" and "rel" passed after clicking on Find Content button of "Related Content" related list?

 

Any help will be apriciated!!

 

Thanks in advance

Lakhan