Module Description
CopySandbox is an app for Business Central that allows you to manage the automatic creation of one or more Sandboxes within the current Tenant through a dedicated interface.
Additionally, the app allows you to define custom rules to delete or modify records and fields in newly generated Sandboxes.
Setup
To set up the app, open the search lens and type Copy Environment Setup .
The setup contains three groups of information:
The Microsoft entra ID: made up of client ID and Secret (to be able to access the API functions for copying and deleting environments);
Environment info: consisting of the environment name only, which will be the new name of the sandbox you want to create;
Job Queue Entry Info: The remaining fields provide information regarding the job queue scheduling for copying the environment. The Execute Now field allows you to execute the copy immediately, but only once.
Creating the queue
The Schedule Copy Environment action generates a job queue that takes care of:
- Create a copy of the current environment.
- Generate a new Sandbox with the name specified in the setup.
Warning: If a sandbox with the same name already exists, it will be automatically deleted before the new one is created. You must have at least one free sandbox slot in your tenant.
Example: If the name CopiaDev is configured, a Sandbox with that name will be created at the defined times.
Rules when Copying
During Sandbox generation, you can apply rules to delete or modify data.
To manage these rules:
- Open the search lens and type Copy Environment Rules .
- The list of configurable rules will be shown.
Rules can be of two types:
- Automatic: Run automatically when the Sandbox is created.
- Manual: Can be performed manually and affect the current environment.
Note: Automatic rules can also be applied manually, but only on the current environment .
Filters on records and fields
Each row represents a table, on which to perform a deletion or modification.
The modification of individual fields can only be applied with the modification operation type.
A filter can be applied to each of the two types of operation.
You can choose whether to apply the rule:
- To all companies (specific field)
- Or only to certain companies (specifying the filter).
Manual Execution
It is always possible to start any type of rule via the action available in the header.
Manually running rules will only affect the environment currently in use .
Advantages of automatic rules
Automatic rules run transparently whenever you create a new Sandbox.
This means that: even if the environment copy is not started via the CopySandbox tool, but via other standard tools or procedures, the automatic rules will still be applied to the new environment, since they are executed immediately after the Environment Cleanup operation.