{"id":21016674,"url":"https://github.com/gsa/sf-sandbox-post-copy","last_synced_at":"2026-02-04T21:37:44.234Z","repository":{"id":137795288,"uuid":"55064390","full_name":"GSA/sf-sandbox-post-copy","owner":"GSA","description":"A framework for managing automation tasks that are fired upon sandbox refresh in Salesforce orgs. ","archived":false,"fork":false,"pushed_at":"2019-07-25T16:32:29.000Z","size":154,"stargazers_count":56,"open_issues_count":7,"forks_count":28,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-07-21T09:32:29.480Z","etag":null,"topics":["salesforce"],"latest_commit_sha":null,"homepage":"http://gsa.github.io/sf-sandbox-post-copy/","language":"Apex","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-30T13:15:35.000Z","updated_at":"2025-06-05T14:07:40.000Z","dependencies_parsed_at":"2023-05-22T14:15:15.099Z","dependency_job_id":null,"html_url":"https://github.com/GSA/sf-sandbox-post-copy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GSA/sf-sandbox-post-copy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fsf-sandbox-post-copy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fsf-sandbox-post-copy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fsf-sandbox-post-copy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fsf-sandbox-post-copy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GSA","download_url":"https://codeload.github.com/GSA/sf-sandbox-post-copy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GSA%2Fsf-sandbox-post-copy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29096500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T21:05:08.033Z","status":"ssl_error","status_checked_at":"2026-02-04T21:04:53.031Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["salesforce"],"created_at":"2024-11-19T10:15:27.211Z","updated_at":"2026-02-04T21:37:44.220Z","avatar_url":"https://github.com/GSA.png","language":"Apex","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sf-sandbox-post-copy\nA framework for managing automation tasks that are fired upon sandbox refresh in Salesforce orgs. \n\nBACKGROUND\n\nPreparing sandboxes for use by development teams or other users has traditionally required manual action.  \n\nWith the Salesforce Spring '16 release, the platform provides a capability to automate data manipulation or business logic tasks.  \n\nMore specifically, the platform defines the SandboxPostCopy interface and allows an administrator at the time of a sandbox create or refresh action to select an Apex class implementing this interface.  The Apex class then executes within the sandbox as it is prepared for use.\n\nThis repository contains an extensible framework for organizing sandbox post copy automation tasks within your org.\n\nFRAMEWORK OVERVIEW\n\nApex Classes\n\n\tSBX_PostCopyManager - Implements the Salesforce SandboxPostCopy interface.  Delegates to SBX_PostCopyWorkerFactory to obtain a collection of classes containing automation logic then invokes each class's processing.\n\n\tSBX_PostCopyManagerTest - Test class for SBX_PostCopyManager.\n\t\n\tSBX_PostCopyUtil - Utility functions used by the framework.\n\n\tSBX_PostCopyWorker - An abstract class defining behavior common to all automation tasks and defining an abstract method which subclasses override.\n\t\n\tSBX_PostCopyWorkerFactory - Factory class responsible for creating all subclasses of SBX_PostCopyWorker for the organization.  Uses the Post Copy Task custom metadata type and the Type class to instantiate each required class.  \n\n\tSBX_PostCopyWorkerFactoryTest - Test class for SBX_PostCopyWorkerFactory.\n\n\nCustom Objects\n\n\tPost Copy Log - Records the success or failure of an automation task\n\nTabs\n\n\tPost Copy Log\n\t\nPage Layouts\n\n\tPost Copy Log Layout\n\t\n\tPost Copy Task Layout\n\t\nCustom Metadata Type\n\n\tPost Copy Task - Each record identifies an Apex class which performs an automation task during the creation or refresh of a sandbox. \n\nINSTALLATION\n\nUse the Force.com Migration Tool to deploy the framework using the code, configuration and package.xml from this repository. \n\n\nEXTENDING \u0026 USING THE FRAMEWORK\n\n1. Implement each of your automation tasks in the run() method of an Apex class extending SBX_PostCopyWorker.\n\n2. Create a corresponding record in the Post Copy Task custom metadata type for each Apex class.\n\n3. Deploy your Apex class(es) and the custom metadata type record(s) to production.\n\n4. Initiate a sandbox create or refresh action.  When prompted, specify SBX_PostCopyManager as the Apex class.\n\n5. Once the sandbox is accessible, review record(s) in the Post Copy Log custom object to view the status of each task.\n \n\nRUNTIME CONSIDERATIONS\n \nThe subclasses of SBX_PostCopyWorker will execute in a single transaction and in aggregate are subject to the Per Transaction Apex limits.\n \nThe synchronous limit of 100 SOQL queries in a transaction could be reached as the number of subclasses grows.  Should this limit be reached, move the processing of the SBX_PostCopyWorker subclass to another class that implements the Queueable interface.  In the run method of the SBX_PostCopyWorker subclass, call the Queueable class using System.enqueueJob.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fsf-sandbox-post-copy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgsa%2Fsf-sandbox-post-copy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgsa%2Fsf-sandbox-post-copy/lists"}