Announcement

Collapse
No announcement yet.

Custom Config

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom Config

    I followed the example in the documentation here:



    It works perfectly, in that the panel is displayed in the Administration. I entered values for the parameters and pressed save. No I can access them using the Config->get($key) option.

    However, when I reload the Administration page, the saved values do not display in the fields in the UI. Is there some step missing the View (client/custom/modules/my-module/src/views/admin/my-settings.js) to retrieve the values and add them to UI? I assumed this functionality would be taken care of in the base View class.

    Any advice will be greatly appreciated.

  • #2
    If you provide the code your added it would be easier to say. Maybe you set internal visibility.

    Comment


    • aldisa
      aldisa commented
      Editing a comment
      You are right. I had set the "level" parameter in Espo/Modules/MyModule/Resources/metadata/app/config.json to "internal". I have changed it to "admin" now and the values remain visible in the Admin Panel. Thanks for pointing me in the right direction.

      Mostly these custom Config parameters are used in backend code in the custom Module I have built for an API integration. But these APIs do get called when non-admin users are interacting with the UI. Will these be retrievable using the Config class in the backend? I notice that setting them as "internal" got them stored in the <espo>/data/config-internal.php while setting it as "admin" stores them in the <espo>/data/config.php file.

      I am able to access them when I run a Job at the Command Line.

      My only concern is when backend code is called due to an action taken by a non-admin user. I need to be able to access the parameters in that situation.
Working...
X