I see the mixin option on my business objects, but what can it be used for?
You can think of a mixin as a set of properties and/or behaviors that you want to apply to several other business objects. A simple example would be a Last Modified mixin that has a lastModified property and an Set Last Modified behavior that sets the value before update. You cod then apply this mixin to every business object and they will automatically have that property and behavior. You can read more about mixins at Apex Designer Docs.
The docs talk about mixin’s in terms of properties and behaviors that act on properties, but don’t mention how to call a behavior that you’ve put on a mixin.
For example, I have a mixin that holds further metdata about the business object, like a list of sort columns, and I want to retrieve that (as a class behavior).
Can you tell me what the syntax for that is?
A mixin adds properties and behaviors to the objects that they are applied to. If the mixin has a property named “autoSync” and a behavior called “sync”, you can reference those on any business object with the mixin as if they were added directly to the business object.
It looks like you may be referring to the mixin options that you can specify when applying that mixin to a business object. If you want to apply the mixin and then get the settings from it, you can put a getSettings class behavior in the mixin that just returns mixinOptions.
am trying to call a class level behavior to get the configured sort columns…but keep getting an error that the getSortColumns is not a function…am I calling it wrong?
const sortCols = BOClass.getSortColumns();
In your example, the BOClass variable name is probably misleading. A better one could be “BOMetadata”. You will see the class is a key inside that BOMetadata object.