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
Bishwambhar SenBishwambhar Sen 

Is it possible to Publish a community via Apex? I am trying to automate sandbox post refresh steps using Apex.

Hi Ohana,

I am trying to automate my sandbox post refresh steps using Apex. Is it possible to Publish a community using Apex?
AbhishekAbhishek (Salesforce Developers) 
Please use Ant script or go with the standard salesforce feature SandboxPostCopy for more go through the link.


https://releasenotes.docs.salesforce.com/en-us/spring16/release-notes/rn_deployment_sandbox_postcopy_script.htm


It's not possible to publish a community using APEX.

You can create an Idea for it in  Idea Exchange. Based on the Votes it will be implemented in the future.


If it helps you and closes your query by marking it as solved so that it can help others in the future.

Thanks.