Salesforce Imp Account Connection

More of a best practices question here regarding the salesforce app.

Currently it is built to only connect to a prod version of salesforce and not a imp. Hypothetically, if I wanted to build it to connect to an imp, I am assuming I would need to make a duplicate of the app, change the url to match the imp, and duplicate all the triggers and actions to work with that new app.

  1. Do I need to duplicate everything or is there a way to simply recreate the app with the new url?

  2. If i didnt want to hardcode the url in, could i pass in a url either through a 3rd keyvault value, connection value, or a entry parameter and which do you think would be best to allow it to be flexible to connect to multiple dev accounts? (not connect to multiple within the same automation, just be able to use it multiple times for different accounts)

  3. Could we bypass all of that by simply changing the default app to have a prod/imp flag and if imp you enter your url otherwise it uses the default?

Just wanted to get your thoughts. Been working on some SF automations recently and testing against an imp instance would be helpful instead of having to connect to prod

There’s no right or wrong way per se, but generally prompting the user to ask if they want to use sandbox or production and then storing the base URL in the credentials makes it easier so you don’t have to replicate assemblies.

In dev.apiant, see these examples:

Zoho CRM 0696cf1bff2b4fd889755bfaf10a9e6c is an easy example of just storing a base url

Clover b7c90cd25da9480d89c05ce2aa6836f4 is an example of loading different OAuth API keys based on the choice of environment

MINDBODY 75977c739b1947048c150a5a2d1b2b47 a complex example of showing different instructions to the user based on which environment is selected

Then in action/trigger/etc assemblies you fetch the base URL for the selected environment from the user’s credentials and use a URL Builder module like so:

OK great. So since I want to do this with a supplied app (and we shouldn’t change those ourselves since you will overwrite them later with any updates) how do you recommend I go about handling this?

For baseline apps we provide like Salesforce, you have to first make your own copy of the assemblies you want to customize.