3

In my managed package I have included a Remote Access application that references my external web site to handle various integration tasks including:

  • Product fulfillment requests/cancellations
  • Client specific options to populate Visualforce dropdown elements

In my supporting Apex Controller Extension classes, I reference the live site URL, but for testing purposes I would like to reference a test server so orders are not fulfilled.

Is there a suggested approach for having production and test Remote Access applications accessible within a managed package?

5

I've seen this managed with Custom Settings. You could either have a URL field or just a checkbox. Everywhere you reference the URL, you'd check the custom setting instead. You'd also need to provide a Visualforce page to manage your application settings.

The benefit of using Custom Settings is that they can be accessed without SOQL and are fast to access.

  • Thanks Daniel. This approach has worked so far. I ended up with a default value in the code and was able to override the value for testing with a custom setting. – Brad Ullery Aug 9 '12 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.