So you need the context entity. Then I think it is better to use another widget, JavaScript widget (with Context) for this.
With this widget you can get the Mendix object of the DataView and use this as a variable within the JavaScript code in the widget. Get the guid of it and then use in a Client API call like below. If you only have one guid, still add it to the array, as an input parameter to the below API call:
mx.data.action({
params: {
applyto: "selection"
actionname: "MyFirstModule.GetFavoriteFood",
guids: [ "281530811285515", "281530811285506"]
},
origin: this.mxform,
callback: function(obj) {
// expect single MxObject
alert(obj.get("manufacturer"));
},
error: function(error) {
alert(error.message);
}
});
Hi Ivo Sturm,
I am trying to implement the solution that you have provided but it is not working . What exactly I need to do is I want to pass two parameters (unit and Parameter) values to microflow(Show_ProductionGraphData).These values I am passing directly from widget It is not coming from any entity.So could you please guide me on this how can I pass these values to microflow without using GUIDS and what object do I need to pass inside the callback function.I do not want to use any dojo library.
params: {
applyto: "selection",
actionname: "MyFirstModule.Show_ProductionGraphData",
guids: [ "281530811285515"],
unit: vUnit,
parameter: vParameter
origin: this.mxform,
callback: function() {
alert(vUnit,vParameter);
// var parameters = vUnit;
//return temp;
},
error: function(error) {
// alert(error.message);
console.error(error);
}