Get Current Object GUID using client APIs

0
suppose that we have a page that contains data view for single object, is there is a way to get this object GUID if the page opened using client API’s ?
asked
1 answers
0

if a page is waiting for an object you need to send it. 

But it may be more easy to do the logic on the page itself, using a data source microflow that is retrieving the object. 

If you can't do that, then yes you need to retrieve the correct guid of the object that you want. 

take a look at the doc in the mx data part here : https://apidocs.rnd.mendix.com/9/client/mx.data.html

there is probably different way to do it but what I already did in the past is to use a microflow that retrieve the object that I want, you can then use the that object to open your page. 

 

here is an example : 

 

mx.data.action({
    params: {
        applyto: "none",
        actionname: "MyFirstModule.JS_Retrieve_Object_Microflow"
    },
    origin: this.mxform,
    callback: function(obj) {
       console.info(obj);
    },
    error: function(error) {
        //alert(error.message);
    }
});

answered