Retrieve over association executed in client instead of on server - Mendix Forum

Retrieve over association executed in client instead of on server

17

When using a “retrieve over association” on a page or in a nanoflow in an online web app, the client calls the server although all information may be in cache. Especially when both the owner and the referred object of the association are non-persistent entities, it should be technically possible to return the requested object(s) without a call to the application server.

Being able to execute the “retrieve over association” in the client instead of on the server will result in a much better performance retrieving non-persistent objects, as no connection has to be made sending the current state.

Currently, you can't fix this using a javascript action in a nanoflow, as you have to use the mx.data.get function to retrieve associated object(s), which will call the server with a retrieve_by_path operation. See also https://forum.mendix.com/link/questions/89974 where this “strange behaviour” is being questioned.

asked
1 answers

One note: I believe the fetch() function from an MxObject is capable of getting data from the browser’s object cache:

https://apidocs.rnd.mendix.com/8/client/mendix_lib_MxObject.html

In some previous testing I was able to confirm that this code did not execute a network call:

myObject.fetch("TestModule.SelectedOrders/TestModule.Order", function(orderList) {
    resolve(orderList);
});

 

Created