0

I need to store and retrieve settings (with application scope). Is there anything suitable included OOTB?

My aim is to have them easy accessible from the Tools or System (for editing) menu with the ability to feed them via the gradle methods.

mrovnanik
  • 123
  • 9
  • What sorts of settings? Business level settings are best in the database, in the user or user group preferences (or other more specific structured entities, like payment gateway configuration for example). System level settings are mostly in the Moqui Conf XML file for the framework and you can do quite a bit with Java system properties used in code, in various Moqui Conf XML configuration attributes, and even set default values for Java system properties in the runtime or component Moqui Conf XML files. – David E. Jones Aug 06 '16 at 17:13
  • In this case, I want to store data that may be considered as preferences. The data is related to a party record and is used to render specific colors (for specified parties) in a FullCalendar widget. I have two options, either store it as a party related record or create a new entity. – mrovnanik Aug 07 '16 at 18:22
  • Would be nice if the question was changed, but I'll answer based on this. – David E. Jones Aug 12 '16 at 06:00

1 Answers1

0

The entity designed for this is the UserPreference entity. There are convenience methods on the UserFacade (ec.user) for getting and setting these preferences, and they are already used for things like setting the light/dark theme, etc. There are even transitions in the apps.xml screen that can be used to set preferences, and screens that use them.

David E. Jones
  • 1,721
  • 1
  • 9
  • 8