The re-introduction of Novulo Sub applications in June 2024 has triggered minor changes to existing components, and will require this same change on other components.
This post explains context and how-to for this change and how to handle the Composer warning when N_ApplicationLoginAccount.N_Current default my organization (fx)
cannot be found.
Context for sub applications and multi-tenant
When using Novulo in a multi-tenant set-up, you will, for various data types, need to set the “My organization” - the tenant that is responsible for the registered data.
For Sales, the ‘my organization’ is the selling entity; for Purchases, the ‘my organization’ is the buying entity and for Inventory counts the ‘my organization’ is the entity who operates the warehouse.
Using sub applications in your application
Sub applications and sub application groups must be created manually.
In a typical set-up, Sub application groups are related to Organizations, and Sub applications to departments.
Default values for My Organization
In a common application setup without Sub applications, the user is linked to a Contact and Connection and that returns the ‘My organization’ that the user belongs to.
This value is typically the default value when registering new Sales, Purchases or Inventory counts.
Switch between organizations with sub applications
In a multi-tenant set-up with Sub applications, users are able to switch between organizations and departments while working in the application in an easy way.
When using sub applications, changing from organization and departments, will make that when entering new Sales or Purchases, this selected organization to be the default value, until you change the organization again in the top of your screen.
Depending on your rights profile, you will still be able to change the ‘My organization’: the sub application will only affect the default value.
Without sub applications
When your application doesn’t have sub applications, the default value will still come from the Connection contact linked to the User.
Implementation: reference Architecture
In the reference architecture, the value for the user’s default Organization and Department is available through two features
N_ApplicationLoginAccount.N_Current default my organization (fx)
N_ApplicationLoginAccount.N_Current default department (fx)
These features are produced through various components that are substitutes of each other (so you need to choose one).
- Both are produced with M5737 Novulo Sub Applications
- M10601 produces the My Organization. When updating Novulo Sales M3445 to r760 or higher, or Novulo Purchases M3039 to r1418 or higher, selecting M10601 will keep the functionality as it was.
- Alternatively, you can use Novulo Multi Tenant M6337 which allows you to define a default ‘My organization’ at user level, irrespective of the linked person.
- If you register your responsible departments for (for example) Sales or Purchases, with M10294 and M10301, you need to define the default department. Without Sub Applications, you will need M10602.
Implementation in components
In your component, using these consumed features, you can set the default values for the My Organization like this:
~N_ApplicationLoginAccount:load(System:getCurrentUserId()).~default_my_organization_fx)
If you want to fallback to the first ‘My organization’ when the user has no linked organization, you can use this approach using IfNull().
~N_ApplicationLoginAccount:load(
System:getCurrentUserId()).~default_my_organization_fx.if_null(~N_Organization:first({~N_Organization, this , ~is_my_organization.equals(YesNo:load(1)), id.asc})
)
Which components are using this new default value?
To check which components, from which revisions, support the new default value: check for the components that Consume N_ApplicationLoginAccount.Default my organization (fx). See Concept Implementations for the how-to.