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

Possibility of making a 'New Content' button with visualforce?

Is there any documentation or discussion on how to create a 'New Content'  button so we can add them to standard or custom object  page layouts?


My first solution was just to write a Visualforce page that redirects to a workspace based on some criteria of the retURL object. But then the user still has to click a second button (Contribute). 


Since $Action.Content.New is not valid, I assume this ability is not ready for primetime? Any ideas?


Do you wish to add fields to objects via the content button or you just want to have an interface for adding existing fields to pagelayouts.

In acse you want to modify schema (object add, delete , modify fields of objects) best method would be to write a 3rd party program  using Dot net based on the metadata API .

In case you wanted a UI to add/ remove existing fields to pagelayouts for that you need to do some custom database design addition say have a settings object where to store information about the modifications in layouts and generate layouts after querying the custom settings objects.

But it is like buying an aeroplane and using it like a bicycle, as Saleforce UI is quite capable of doing this is very user friendly and lucid manner.

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.


See if this helps

Content upload It's just the steps w/o pseudo code but Ill add that later

Here's a post demonstrating the steps required to accomplish your goal.  Synopsis:  Add an Apex class to insert the ContentVersion and a VF page using that class as an extension.  Add a Custom Button using that VF page as its content source.  Expose that Custom Button on your Custom Object layout.  Ensure all profiles using this feature have the Apex Class and VF page added to the profile


Programmatically Upload Content