How does everyone handle the following use case: ...
# suitescript
How does everyone handle the following use case: In Production, you're connected to an external system and exchange data back/forth. Then, there's a sandbox refresh, and now you have both Prod/Sandbox sending data to the same external system. I've tried a few things, but I'm interested in hearing other solutions.
I have a constants file that checks the runtime environment. The external systems rarely change, so if the sandbox gets refreshed, the endpoints or whatnot don't get overwritten
Ok, I'm more worried about the new sandbox environment will now start sending data to the production env from sandbox. Not so much that sandbox get's overwritten
We do it like @ehcanadian with
Copy code
if(runtime.envType == runtime.EnvType.SANDBOX) {
	// Do sandbox things			
} else if(runtime.envType == runtime.EnvType.PRODUCTION) {
	// Do production things
We have a script parameter for the environment it is intended to run in. In the script, we check that the current environment is equal to the one defined in the script parameter, and throw an error if not.
on my previous company, I build solution that would store credentials for different environments in Custom Record (Prod, SB1, SB2, SB3) and the library would pull the related custom record entry based on the account and retrieve the endpoint url and credentials from AWS Credentials Manager. Source code is below but I didn’t publish an article about it: