Home > Forum > Rules, JS, SQL > Info: WEBCON BPS 2023 R2: window.initialModel is gone

Info: WEBCON BPS 2023 R2: window.initialModel is gone
3

MVP

Hi everyone,

maybe someone else is using some internal JavaScript objects and if this is the case, check whether you are using
window.initialModel and make adjustments. In R2 it's gone.

Most of the objects of the initialModel can be accessed via the liteModel.

/api/nav/db/${parameters.dbId}/element/${parameters.instanceId}/desktop

If you have no idea what I'm talking about, than everything is fine. :)

Best regards,
Daniel

Hi Daniel!

Thanks for the info.

We haven't installed R2 up to now, but we're planning it.

Do you mean window.initModel?

We are using window.initModel.isAdmin, to detect admin rights, but this is not related to a workflow instance.

We need to detect this in any dashboard, so I am not sure, how to achieve this with the object missing.

Best regards, Nik

MVP
In reply to: Nikolaus Schusser

Hi Daniel!

Thanks for the info.

We haven't installed R2 up to now, but we're planning it.

Do you mean window.initModel?

We are using window.initModel.isAdmin, to detect admin rights, but this is not related to a workflow instance.

We need to detect this in any dashboard, so I am not sure, how to achieve this with the object missing.

Best regards, Nik

Hi Nik,

that's a different one and I hope that this will stay, or I will get problems too. :)

Up to 2023 R2 there was window.initModel and window.initialModel.


Best regards,
Daniel

In reply to: Daniel Krüger (Cosmo Consult)

Hi Nik,

that's a different one and I hope that this will stay, or I will get problems too. :)

Up to 2023 R2 there was window.initModel and window.initialModel.


Best regards,
Daniel

Hi Daniel!

Thanks for the clarification.

And yes, I will get problems too ;-)

It is always dangerous to use some internal endpoints / variables because the are likely subject of change.

Best regards, Nik

MVP
In reply to: Nikolaus Schusser

Hi Daniel!

Thanks for the clarification.

And yes, I will get problems too ;-)

It is always dangerous to use some internal endpoints / variables because the are likely subject of change.

Best regards, Nik

Hi everyone,

in case you are really needing the data from this endpoint, e.g. you can't get the data via a business rule.

You could grab/take a look at:
https://github.com/Daniel-Krueger/webcon_snippets/blob/main/utils/utils.js

and use getLiteModel
https://daniels-notes.de/posts/2023/ux-form-rules-revised#getlitemodel

Best regards,
Daniel