0

I would like to understand:

  1. If we can write a post install script to create a named credential that is required to be able to view a certain report in the managed package(the report feature that I am trying to access queries an entity that is not exposed to the tooling api)?
  2. How do we setup Tooling enablement in an org?
5
  • Does this answer your question? Creating/updating NamedCredential from Apex
    – identigral
    Oct 20, 2020 at 1:12
  • 2
    Don't think you can do that in a postinstall script. That context does not get a Session Id to make callouts to its own org.
    – David Reed
    Oct 20, 2020 at 1:15
  • Thanks for your answer. @DavidReed Could you please help me understand what should be the setup steps in order to enable tooling in an org? Are these the right steps? if not, could you please point me to the documentation for setting up tooling in an org? medium.com/dyno-dev/calling-tooling-api-from-apex-1913933284da
    – juhi juhi
    Oct 20, 2020 at 3:33
  • Too much for a comment. The Tooling API is an out of the box feature. You may need additional setup depending on the calling context. Major security implications. Since this question has a good answer, please consider opening a new question with complete details of the situation.
    – David Reed
    Oct 20, 2020 at 3:48
  • @David Reed The access token can be obtained via another call - connected app (hosted in another org...) or SOAP login. Not trivial but definitely possible.
    – identigral
    Oct 21, 2020 at 20:14

1 Answer 1

0

There's no way to do this in a Post-Install Script. You would need to create a Visualforce page and configure it to be the Configure option for your package. The administrator can perform this setup post-installation.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .