Layers Event Priority

Hello Kinetic users!

You create a LayerA with a custom event that is triggered after the system event AfterInitialize. The custom event action is to display a Toast message ‘A’.

You also create a LayerB (independent of LayerA) with a custom event that is triggered after the system event AfterInitialize. The custom event action is to display a Toast message ‘B’.

Expectation :

  • When applying LayerA followed by LayerB (or vice-versa), both events shoud be executed.

Reality :

  • When applying LayerA followed by LayerB, only the LayerB custom event is executed.

  • When applying LayerB followed by LayerA, only the LayerA custom event is executed.

I have attached the JSON generated when LayerA is applied first, followed by LayerB, and vice-versa. You can see both custom events in the JSON as expected, in the correct order … but only one is executed.
LayerA_LayerB.txt (56.8 KB)
LayerB_LayerA.txt (42.2 KB)

Questions : Is this a feature or a bug in our version (2021.2.11)? Is there a workaround if I want to initialize TransView values (using row-update) in LayerA, and initialize other TransView values in LayerB?

Layer order is important to avoid UI conflicts, but I would not have expected events to be impacted this way.

As always, I appreciate your help.

I believe Layers are are applied in sequence as a DIFF

So it makes sense that if an event is over-written by a later layer only the later layer will be executed.

But maybe I misunderstood.

If both layers had an event with the same ID (Custom_AfterInitialize), then it could make more sense to overwrite the event.

Some of my layers require to execute things after the form is loaded. Do you have an idea how I can deal with this?

So, what’s happening here is you can only have one before/after event per event, so the child layer is taking priority over the parent layer.
This can be demonstrated if you create an event in a single layer (say “After” AfterInitialize) and then go make a second event in the same layer for the same “After” AfterInitialize; it won’t even show up in the list.

You’ll have to hook the child event into a different one. For instance, the parent could use “Before” AfterInitialize an the child could use “After Initialize”.

1 Like

Alright! Thanks for the details :wink:

EDIT : … and for you other Kinetic posts that have been very helpful to me.

1 Like

2 Likes