on 12-14-2016 6:06 PM
I'm trying to save a property from an OData model into a variable like this:
var myModel = this.getView().getModel();
var value = myModel.getProperty("/ZcountGeneralSet('')/Werks");
// value returns undefined
I'm wondering if the syntax for empty parameter (' ') is wrong, because it works if I pass in the number that "Werks" shall return (7001). The property can also be retrieved when calling ZcountGeneralSet(' ')/Werks in the odata service in a browser, but not in sapui5.
Is there another way or another syntax to retrieve the property in sapui5?
(Maybe another syntax for passing empty parameter?)
check in dev tool to see what is inside of your model. if you see ZcountGeneralSet(' ') as an obj in your model, you should be able to get it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.