Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

gregory_longe
New Contributor III

Engine API: Modify Master Dimension

Hey all,

I am still struggling with the Engine API. I tried to create an extension using qSocks that changes the reference field in a master dimension upon user request. As far as I know, I could use two methods to achieve this:

- applyPatches

- setProperties

In the case of applyPatches, the code is running fine but the changes are not reflected in the Qlik Sense application (neither in the desktop or server version). If I check the change via Dimension.getProperties, I see that the change indeed happened. The major difference with the applyPatches function of a generic object is the absence of a boolean to indicate that it concerns a soft patch or not.


In the case of setProperties, the changes are reflected in the Qlik Sense application. When the app is saved by the user on Desktop or refreshed/closed on the server, the master dimensions are however destroyed. They are simply gone and in the objects, the master dimension is directly replaced by the corresponding field of the data model .

Can any of you can help me to understand these phenomena and to come to a stable solution?

Thanks in advance,

Kind regards

Gregory

5 Replies
Employee
Employee

Re: Engine API: Modify Master Dimension

Are you saving your changes? On Desktop you would have to persist the entire app via DoSave() and on server a SaveObjects() would be sufficient, otherwise your changes are lost

gregory_longe
New Contributor III

Re: Engine API: Modify Master Dimension

Alexander,

Thanks for your reply, but I am using DoSave after each change, both on desktop and on server. So that should not be the problem.

I don't need to do any refresh to make the changes in the master dimension visible, right? I am doing a similar thing to change the titel of objects and there, applyPatches is reflected immediately in the app.

Any other ideas?

Gregory

gregory_longe
New Contributor III

Re: Engine API: Modify Master Dimension

All,

I noticed that the changes made to master dimensions are only reflected in the dashboard if I call the applyPatches method on the sheet objects afterwards. Calling applyPatches on the sheet objects seems to trigger a refresh of the objects, thereby refreshing the master dimensions as well.

The only remaining problem is for master measures: in the list of master measures, the new names are not shown. When I however click to edit a measure, the pop-up window shows the updated name in the name text box. For master dimensions, this behavior is not present and the new names appear immediately.

Anyone any experience with this? Does anyone have a solution?

Kind regards

Gregory

Highlighted
Partner
Partner

Re: Engine API: Modify Master Dimension

Hi Gregory! Did you found solution to the problem? I am also trying to apply patches on master dimensions/measures and it needs to call applypatch on the sheet objects to get refreshed view.

gregory_longe
New Contributor III

Re: Engine API: Modify Master Dimension

Hey Alexander,

I didn't manage to resolve the actual cause, but I've implemented a workaround by using promises. I first perform the changes on the master dimensions and measures. Once finished, I trigger the sheet object changes. Everything is reflected as it should be.

Kind regards

Gregory