Hi,
Apart from the question why you would want this (you can do most things in microflow/nanoflows?)
The documented way is as follows (https://apidocs.rnd.mendix.com/10/client/mendix_lib_MxObject.html):
export async function JS_Test(parameter) {
// BEGIN USER CODE
parameter.fetch("Module.TestEntity_MendixAccount/Module.MendixAccount", function(value) {
alert("Name is " + value.get("FullName"));
});
// END USER CODE
}
Good luck!
__
Update 2 Oct:
If you want to return it back to the nanoflow like this, you need to make use of the Promise. Updated code below.
export async function JS_Test(parameter) {
// BEGIN USER CODE
return new Promise((resolve, reject) => {
parameter.fetch("Module.TestEntity_MendixAccount/Module.MendixAccount", function(value) {
const fullName = value.get("FullName");
alert("Name of person's friend is " + fullName);
// Resolve the Promise with the result
resolve(fullName);
});
});
// END USER CODE
}