Hi Divya,
you can check this document it’s so helpful: https://apidocs.rnd.mendix.com/8/client/mx.data.html
best regards,
Abdelrahman Abu Al-Ata
I'm afraid I've no complete answer for you, I struggle also with it.
The reason for the undefined message, is that the nanoflow should have been declared first.
You can however provide the nanoflow as a parameter to the JS-action.
Same applies for the context.
So you get something like this:
return new Promise(function (resolve, reject) {
mx.data.callNanoflow({
nanoflow: testNanoflow, // parameter JS-action
context: testEntity, // parameter JS-action
origin: page, // ??????
callback: function(result) {
alert("Nanoflow completed with result " + result);
},
error: function(error) {
alert(error.message);
}
});
Leaves the origin I guess, perhaps somebody else can provide some final answer here.
Hi Divya,
Call I microflow could be really easy. with the Nanoflow parameter (not sure what version it was introduced)
https://docs.mendix.com/refguide/javascript-actions#2-2-2-type
Before it was a bit harder, to get the nanoflow exported, it required a helper widget
https://appstore.home.mendix.com/link/app/111132/
Alternatively, you could also return the date from the the JS action and call a sub nanoflow (now supported) with the data of your custom action.
Cheers, Andries
For those who arrive here wondering how to pass multiple parameters to the nanoflow via JS, following is a snippet:
export async function JS_ExecuteSyncInBackground(nanoflow, obj1, obj2, obj3) {
// BEGIN USER CODE
nanoflow({ParameterName1: obj1, ParameterName2: obj1, ParameterName3: obj3});
// END USER CODE
}