Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6133011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:10:22+00:00 2026-05-23T17:10:22+00:00

I have created a custom visualforce page. Here in the controller class i allow

  • 0

I have created a custom visualforce page.
Here in the controller class i allow the user to create folders.

I want when user clicks OK (a custom button) then the new folder is published as a record in the workspace but i cannot find how to do it.

Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T17:10:22+00:00Added an answer on May 23, 2026 at 5:10 pm

    Finally i achieved a way to publish a record to shared workspace:

            ContentVersion doc = new ContentVersion();
            string before = 'Testing base 64 encode'; 
            Blob beforeblob = Blob.valueOf(before);
            doc.Title = title;
            doc.PathOnClient = 'xyz';
            doc.VersionData = beforeblob;
            insert doc;
    
            doc = [select ContentDocumentId from ContentVersion where id = :doc.id];
            ContentWorkspace shareWorkspace = [select id from ContentWorkspace 
                      where name = :workspaceName limit 1];
    
            ContentWorkspaceDoc docLink = new ContentWorkspaceDoc();
            docLink.ContentDocumentId = doc.ContentDocumentId;
            docLink.ContentWorkspaceId = shareWorkspace.id;
            insert docLink;
    

    Publish Record to Personal Workspace:

            ContentVersion doc = new ContentVersion();
            string before = 'Testing base 64 encode'; 
            Blob beforeblob = Blob.valueOf(before);
            doc.Title = title;
            doc.PathOnClient = title;
            doc.VersionData = beforeblob;
            **doc.FirstPublishLocationID = UserInfo.getUserId();**
            insert doc; 
    

    I have created a blob from String but i need to create a blob that can show a table with all the info that i want to display like size & author name.

    Thanks Paul for the idea.
    May be someone can help me in creating blob of my choice.

    🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom visualforce page. Here in the controller class i want
I have created custom result class to serialize json data to xml. I want
i have created custom components in flex where i have used a button,i want
I have a Visualforce page using a custom controller that is used to edit
I have created a custom control for ImageButton as <Style TargetType={x:Type Button}> <Setter Property=Template>
i have created a custom dialog class public class NewPost extends Dialog { //
I have created custom exception class public class Web2PDFException : Exception { public Web2PDFException(string
I have created a custom module and am using hook_block to programmatically create some
I have created custom aplication resource: class Custom_Entitymanager extends Zend_Application_Resource_ResourceAbstract{ //... public function init
I have created a custom class from a tutorial online. It works fine, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.