Accessing Object in JavaScript action

1
Hi  I have a scenario where I’d like to access Object attributes in JavaScript action scripts.    The above (really basic example) shows a ruleObject (of type Rule in my domain model) with one attribute called ruleString. I can easily pass and access simple string types as parameters, but the moment I need to access a Rule object – JavaScript doesn’t pick up the attribute (unless some form of “get” approach is used. I have tried to use a Type parameter of time Rule as well – but this does not seem to be visible in the code scope.  Seems JavaScript is only parring an object of type MxObject – not Rule.  Example of what I would like to do:  var ruleOK = false; ruleOK = eval(ruleObject.rulestring); Any suggestions? 
asked
2 answers
2

Hi Cobus,

You can use the client API .get function https://apidocs.rnd.mendix.com/8/client/mendix_lib_MxObject.html#get

Cheers, Andries

 

answered
1

let ruleString = ruleObject.get(“rulestring”);

answered