pass param fail with client call a microflow

0
I have a Microflow , it accpet a Object of Domain Model as a param , this microflow only log param and show it; when I use client api call this microflow, it action with success, but message of param with null , why ? mx.data.action({ params: { applyTo: 'selection', actionname: 'Application.Log', guids: ['7318349394477258'] }, callback: function () { // it will be successed console.log('success info'); } }); I'am sure this GUID's object is in existence´╝î I can find in the db, or find it use 'mx.data.get', but Mendix Modeler Console log it null;
asked
2 answers
1

I also had some luck running an mx.data.create function with an mx.data.action inside. 

                    mx.data.create({
                        entity: "YourApp.entity",
                        callback: function (obj) {
                            obj.set("EntityName", entityValue),
                            mx.data.action({
                                params: {
                                    applyto: "selection",
                                    actionname: "MyApp.Microflow",
                                    guids: [obj.getGuid()],
                                },
                            });
                            alert("Object created on server");
                        },
                        error: function (e) {
                            alert("Could not commit object:", e);
                        }
                    });

Good Luck!

 

Bryan

answered
1

Hi,

If the object is persistent you can specify an XPath constraint to retrieve it.

mx.data.action({
    params: {
        applyto: "set",
        actionname: "Application.Log",
        xpath: "//MyFirstModule.Object",
        constraints: "[id=XXXX]",
        origin: this.mxform
    },
    callback: function() {
    }
}, this);

Hope this helps,

Andrej

answered