Is it possible to create your own enum types similar to how the built in ones work (e.g. DisplayMode, Color etc)?
As an example, I want to avoid hard coding integer values for parameters/options throughout the app which refer to related values in an external system which we integrate with.
So it would be much cleaner to define these values in a user-defined enum similar to C/C++.
Is there some editing of the manifest etc which could achieve this?
Creating a Collection or custom Component with custom properties set to specific default values could achieve this, but that's a bloated hack.
Many thanks.
Hi @MarrinerDev
Although this is not exactly an enum, perhaps you could just declare a global variable of data type 'record' that stores your name value pairs?
For example, let's say you add this to the OnStart property of your app.
Set(VehicleType,
{Car:1, Bus:2, Train:3}
)
In formula, you can then do this:
@timl has the right idea here - create a global variable that stores your record, have that record filled with data during the OnStart by pulling that from your external source. There are some changes you can make to the themes.json file within a .msapp file to affect color etc but not all items are picked up by the IDE when you import the file.
I built a template for automating the color properties for all objects inserted as a default here: https://bit.ly/BrandTemplateV2 - you could modify how I've done that to suit your needs for pulling in user-defined properties from a third-party source and the having them applied by default to all new controls added to an App.
Thanks @Anonymous for the mention!
@iAm_ManCat |
Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! |
Thanks! |
User | Count |
---|---|
251 | |
102 | |
94 | |
48 | |
37 |