Hi,
In our CRMPlugins solution, we have a Constants.cs class that defines the following constants:
- Guids
- Picklist values as enumerations
- Role names
- Email addresses
- IsTesting booleans
- API keys
- URL root bases
- Connection strings
- Directory paths
- Environment indicator (dev, staging, live)
- Other constants
Instead of having to re-deploy the project after changing a constant, we would like to control these constants outside of the project. One route is to use an entity that would contain the key and value pairs similar to what a web.config does.
If at any point we need to use a constant, we would just make an SDK call for that value. What if we need to retrieve a lot of key/value pairs? That's a lot of calls. Instead, we can load all of the records. It wouldn't be that many (max 100 records containing 2 attributes).
Questions:
- Would you recommend that I create a SDK call in our base plugin class to retrieve all key/value pair records and set it to a dictionary accessible anywhere in the main plugin execute method or any of its sub-classes?
- Is it possible to cache the record values in the context once every amount of time (30min, hourly)?
- This way just do one retrieval that all plugins can use
Please answer the two above questions so that I can eventually mark your answer as the best answer :).
Thank you for taking the time to read this thread and reply to it!
*This post is locked for comments