Sandbox Best Practices
Define sandbox template
Sandbox templates allow us to pick specific objects and data to copy to our Full or Partial Copy sandbox to control the size and content of each sandbox. Sandbox templates are only available for use with Full or Partial Copy sandboxes. We can select the object data (standard and custom) to copy during the creation or refresh of a sandbox. Below are the steps to create sandbox template-
- Go to Setup > Environments > Sandbox.
- Click the Sandbox Templates tab.
- Click New Sandbox Template or Edit next to an existing template you want to modify.
- Enter a name and description for the sandbox template.
- Select the checkbox for each object you want from the available Objects list
- Click Save.
- Select this template to specify the data during sandbox refresh.
Use Unaric Payments Sandbox class while refreshing sandbox from production
Payments provides a class that automates data manipulation of Payments connections to make your sandbox environment business-ready. This class which run scripts after each creation and refreshes for this sandbox while refreshing the sandbox from production. To use this class:
- Go to Setup > Sandboxes.
- Click on the Refresh link for the sandbox you want to refresh.
- Click Next for the type of sandbox you have selected in the last step.
- Add the Apex class name as Sandbox and click Create to finish. On Sandbox refresh the Unaric Payments sandbox class executes a script which will automatically amend the Unaric Payments settings from the sandbox.
Amend the Payments settings after creating a sandbox
When you create a sandbox from a live production org., Salesforce will copy across the metadata, meaning that the live Payments configuration gets ported to the sandbox. You need to amend the Unaric Payments Custom settings so that you can then create or attach a test Unaric Payments account.
- As an administrator, navigate to Setup > Custom Settings.
- In the list of settings, Select Unaric Payments settings.
- Use the Manage button to show the current settings and click Edit.
- Remove the content of the Customer ID field. If you have an existing Payments test account that you want to link, enter its Configuration ID of that account in this field.
- Make sure the field Is Running Live is unchecked.
- Make sure the field Server URL contains the value test.protectedpayments.net.
- Click Save to finish. You can now go to the Unaric Payments Setup tab and follow the instructions to create a new test account.
If the screen is asking for an API key then contact [email protected] for assistance and include the Configuration ID.
Optional Sandbox Apex class
This class prevents live configuration settings from being copied over to sandboxes. When ran, the class will delete any content in the Unaric Payments protected settings and modify the content of the Unaric Payments settings so that the field Is Running Live is unchecked, the Server URL is set to test.protectedpayments.net, and the field Customer ID is blanked out.
.