从 Apex/VisualForce 检测 Salesforce 版本和/或功能
在 Apex 类中,如何检测版本(即 Group、Professional、Enterprise、Unlimited)。更具体地说,是否有 API 可以检索用户版本的功能(或缺乏功能)?
我试图解决的问题是,从 Group/Professional 版本中,用户无法访问我的应用程序中的自定义 Web 服务,并收到错误 LOGIN_OAUTH_API_DISABLED。有没有办法检测这是否会在 Apex 内起作用?
From within an Apex class, how can I detect the Edition (ie, Group, Professional, Enterprise, Unlimited). More specifically, is there an API to retrieve the capabilities (or lack thereof) for the user's edition?
The problem I am trying to solve is that from the Group/Professional edition, users cannot access the custom Web Services in my app, receiving the error LOGIN_OAUTH_API_DISABLED. Is there a way to detect whether this is going to work from within Apex?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用以下 SOQL 来确定组织的许可证类型:
对于 Professional,它将返回“Professional Edition”。 组织对象页面对此进行了详细介绍。
You can use the following SOQL to determine the Organization's license type:
For Professional it will return "Professional Edition". This is detailed on the Organization object page.
您是否希望发现任何特定的功能?没有办法确定版本(如果可以的话,这主要是转移注意力)。许多差异最终反映在数据模型中,您可以发现使用 描述功能。
如果您想从 apex 检查您的 Web 服务是否已启用/可用,那么您可以使用 apex 标注来尝试调用它(FWIW,错误代码来自 OAuth,而不是来自您的 apex Web 服务)
Are there any specific capabilities you're looking to discover? There's no way to determine the edition (and this would be mostly a red herring if you could). A lot of differences end up being reflected in the data model, and you can discover that using the describe features.
If you want to check from apex if your web services is enabled/available, then you could use apex callouts to try and make a call to it (and FWIW, the error code is from OAuth, and not from your apex web service)