Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [sandboxpostcopy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
19 views

SandboxPostCopy - portal account owner must have a role: []

I am creating a SandboxPostCopy class that generates some mock data in our sandboxes when we do a refresh. If I run the class via anonymous window, it works fine and builds all the goodies. If I run ...
user avatar
0 votes
1 answer
56 views

Add "API Enabled" access to Automated User

I want to create Profile Login Api Range during sandbox creation or refresh. I'm using SandboxPostCopy interface and Metadata Service. I saw something similar in this question : sandboxpostcopy ...
user avatar
3 votes
0 answers
44 views

SandboxPostCopy callout throws UnexpectedException

When I attempt to perform a callout from a SandboxPostCopy class when creating a sandbox, it throws the following UnexpectedException: System.UnexpectedException: Attempt to release db connection when ...
user avatar
  • 849
0 votes
0 answers
71 views

How do I write test methods for a @future method in a SandboxPostCopy class?

My team uses a sandbox for user onboarding, so I wrote a SandboxPostCopy class to populate the training sandbox with sets of records and create test users on refresh. The class compiles and, as far as ...
user avatar
0 votes
0 answers
79 views

Automatically update profile IP restrictions that depend on the environment

Our setup has integrations that access Salesforce through service users. This users profiles have IP whitelists. Now a new system has Internet-facing IP ranges that depend on the environment (...
user avatar
  • 1,154
2 votes
0 answers
318 views

Import CA-Signed Certificate from One Org into Another via MetadataAPI

I am trying to automate the set up of some of my lower sandboxes. In my SandboxPostCopy class, I'm using the FinancialForce MetadataAPI wrapper MetadataService to query and upsert a certificate. (...
user avatar
  • 1,818
2 votes
1 answer
850 views

Dynamically set Connected App Callback URL

I am trying to dynamically update the callback url in a connected app. When creating a sandbox, I want to run an apex class that change the callback URL from a production to UAT callback endpoint. ...
user avatar
  • 1,818
1 vote
1 answer
242 views

Update email address and profile on SandboxPostCopy MIXED DML OPERATION error

I've been trying to update user emails and profiles after a sandbox is created and using the SandboxPostCopy interface. However I keep running into the below error: Update failed. First exception ...
user avatar
  • 89
0 votes
1 answer
126 views

Workflow Task Error When Trying to Deactivate a User from a SandboxPostCopy Apex Test

I'm trying to deactivate a user in an apex test. But am getting an error that the user (that I just created in the test) in being used by workflow tasks. The class implements SandboxPostCopy and is to ...
user avatar
1 vote
0 answers
716 views

SandboxRefresh Class will not run on refresh but will run in Anonymous Context

Here is my code for the SandboxRefresh class that I'm trying to run. The batch classes have a finish method that does attempt to send emails, and I'm wondering if the default Deliverability settings ...
user avatar
  • 1,268
4 votes
0 answers
83 views

What Does Automated Process User Not Have Access To?

While working on a SandboxPostCopy script, I came across the following warning on a Salesforce article: So it sounds like there are certain things that cannot be done with the script, but I haven't ...
user avatar
2 votes
1 answer
188 views

Does Test.testSandboxPostCopyScript Actually Run DML?

I have a SandboxPostCopy class where I am updating some User fields (example: changing the email to remove the '.invalid' and setting Profiles) where the Users to be updated are controlled by Custom ...
user avatar
4 votes
2 answers
1k views

Is it Possible to Change a User's Email and Reset Password at Same Time via Apex Code?

When using the Saleseforce UI, it is possible to change a user's email and send them a password at the same time by changing the email and clicking 'Generate new password and notify user immediately' ...
user avatar
1 vote
1 answer
74 views

SandboxPostCopy Profile Name

Does anyone know what profile name or Id a SandboxPostCopy implementation occurs in? The code that I have to run after a refresh/cloning keeps hitting a validation rule based on the profile but since ...
user avatar
  • 69
2 votes
1 answer
1k views

Sending email in sandbox post copy

When I refresh a sandbox I have a class that runs to fix some things like email addresses and custom settings. I've also been asked to email the developer the new org ID so that their testing ...
user avatar
  • 1,119
3 votes
1 answer
157 views

Why Apex Exceptions Email Settings are not copied to Sandbox upon sandbox refresh?

Why Apex Exceptions Email Settings are not copied to Sandbox upon sandbox refresh? We need to manually setup Apex Exceptions Email Settings every time after sandbox refresh. Is there any way to make ...
user avatar
  • 13.2k
1 vote
2 answers
2k views

Would Refreshing a Sandbox Wipe Out Certain Metadata?

If I have custom-setting metadata (or any other custom objects) in a partial-copy sandbox and not in production, then I refresh the sandbox, will that metadata be wiped out and have to be recreated? ...
user avatar
2 votes
0 answers
89 views

Pushing a git repository to a Sandbox via a PostCopy script

I am currently trying to automate the whole process for working with Sandboxes in my company. As of now, we have a CLI tool which both refreshes the sandboxes and executes an Apex anonymous script to ...
user avatar
1 vote
2 answers
2k views

Execute SandboxPostCopy Interface from Anonymous Window

How can we execute SandboxPostCopy Interface from Anonymous Window for testing purpose. global class PrepareMySandbox implements SandboxPostCopy { global void runApexClass(SandboxContext context) ...
user avatar
1 vote
3 answers
2k views

Automate master data loading after sandbox refresh

Test.loadData is used to load CSVs into an object during Test Class execution. This test data exists only in the eyes of the test class. In order to load master data using Apex after a refresh, is ...
user avatar
  • 4,532
0 votes
1 answer
259 views

Invalid interface:SandboxPostCopy

I am trying to create class that can be used post sandbox refresh and I am getting Invalid Interface:SandboxPostCopy error when trying to save. Below is the code that I am using. global class ...
user avatar
  • 29
4 votes
2 answers
2k views

Are Scheduled Jobs copied after Sandbox Refresh?

Are Scheduled Jobs copied after Sandbox Refresh? I did a refresh of a full copy sandbox and looked at the scheduled jobs but not all of them are there. Anyone has any ideas of the criteria used to ...
user avatar
  • 518
4 votes
1 answer
1k views

Any good solutions to disable remote site settings after Sandbox refresh?

Has anybody come up with any automated solution for disabling remote site settings after a sandbox is created or refreshed? I'm trying to prevent situations where someone creates a developer sandbox ...
user avatar
  • 288
7 votes
1 answer
771 views

SandboxPostCopy and Organization.IsSandbox

Could you tell me what would be the value of IsSandbox if I specify the following class during sandbox creation? Will it be 'true' or 'fasle'? global class HelloWorld implements SandboxPostCopy { ...
user avatar
  • 195
13 votes
2 answers
6k views

Run Script After Sandbox Creation and Refresh

With the Spring '16 release, there is new functionality where we can set a script to run after refreshing a sandbox. In the documentation it gives an example where it prints the three context ...
user avatar
  • 12.2k
10 votes
2 answers
7k views

How to use new SandboxPostCopy?

The new Sandbox Post Copy tasks are a great addition and I'm eager to try them but until the release to Production starts on Feb. 6, it seems impossible to experiment with the behavior. I ...
user avatar