superfell / SoqlX

SoqlXplorer is an awesome tool for developers using the Salesforce.com platform.
https://pocketsoap.com/osx/soqlx/
Other
273 stars 53 forks source link

basic question: possible to reduce API calls when loading objects following login #146

Closed michaeldesu closed 2 years ago

michaeldesu commented 2 years ago

Hi

Thanks for providing this useful tool. I'm new to Salesforce and have a general question about the API calls made during 'startup' i.e. when the app is collating (describing) the objects. It seems during this time, the API call count fluctuates. I guess this is to be expected - API calls are consumed as info is obtained. For a large prod org like the one I'm connecting to, I am concerned that over time, API calls will be slowly eaten up upon each startup - it's not a huge deal I guess, but I wondered whether it's possible to enable a 'caching' setting to avoid reacquiring object info upon each startup, limit the API consumption, and this will also allow a user to work with the SOQL queries faster (if that all makes sense) as it can take a few minutes for all the objects to be described and queries tend to time out if I run during object info collation.

Thanks.

superfell commented 2 years ago

yes, it's technically possible, but the cache would get increasingly out of date. Checking/bringing it upto date would burn the same number of API calls anyway. Large org's tend to end up with large API limits, so I'd be surprised to hear that the <100 used to describe all the metadata causes an issue. Can you explain your starting query timeout some more? I haven't seen any timeouts while running queries while the describe is ongoing. The 2 shouldn't interfere with each other on either the SoqlX side, or on the salesforce side. (Assuming the network connection from the client isn't heavily constrained).

All that said, the easiest answer to this is to not close the app. It'll keep the metadata cached, and the session will be automatically renewed if it expires. So you can leave the app open indefinitely and it'll continue to work next time you run a query.

michaeldesu commented 2 years ago

Thanks a lot for your answer (sorry for my delayed reply). I appreciate your advice.

About the starting query issue, thanks for mentioning about your experience - based on your that, I'll monitor it more closely & reopen if it becomes an ongoing problem. It may be possible that I had network issues.