Allow SandboxPostCopy to access @isTest Classes - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
120  Points
Idea has been posted. Give it an upvote or downvote.

Allow SandboxPostCopy to access @isTest Classes

Development (Apex, LWC & VF)

Developers spend a lot of time writing Factory Classes or the like which generate Test Data for our Test Classes.  Thankfully, we can annotate these classes with @isTest so they don't count against our Apex Classes' Character Limit.

SandboxPostCopy is a great feature, but it would be amazing if we could access our @isTest Factory Classes since
  1. It's already written to generate Test Data.
  2. It would be very unfortunate if we had to spend Apex Class Characters to generate all that Data when the Apex Classes would never really be used in Production.
As written, SandboxPostCopy Classes can be used in Production Code, but is this necesary?  Similar to @isTest, why not have an annotation called something like "@isSandboxPostCopy" that only allows Classes with this annotation to be executed upon Sanbdox Post Copy?  That way, @isSandboxPostCopy classes can't be executed in Production ... which would allow @isSandboxPostCopy to access @isTest Classes since it's in a controlled execution environment.

Merge Idea · Flag

  • Upvotes
  • Downvotes



from AppExchange


No results found.

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.