Firstly, credit to @Abhay Shirke whom has helped thus far.
The goal is to build functions using variables based on pieces of the BO; I have had some success
Below is an example of what I'm trying to achieve however, concatenating two variables raises an error
Best regards
Stephen
[...]
var x = BO;
var y = page;
var z = x.F_Shortname.getId(); //Returns: F_Shortname
var a = x.z.getValue(); // Raises error: Caused by: TypeError: x.z is undefined
var b = y.z.getTitle();
You cannot concatenate in this manner if you are using secureJS=true (default mode). For more details check out https://leap.hcldoc.com/help/topic/LEAPv9/LEAP/ref_jsapi_javascript_security.html
You would have to do something like:
var x = BO;
var y = page;
var z = x.F_SingleLine5.getId(); //Returns: F_Shortname
var a = get(x,z).getValue(); // Raises error: Caused by: TypeError: x.z is undefined
var b = get(y,z).getTitle();
alert(a + “:” + b);
Many thanks for a sterling bit of help!
Where does the mystery dot (.) come from?
In your example, variables return:
x = BO
z = F_SingleLine5
Looking at the syntax and example:
get(obj,prop)
get(x, z)
Would I be correct in thinking the get function adds the object.property separator?
Best regards
Stephen