cancel
Showing results for 
Search instead for 
Did you mean: 

Passing multiple keys in getProperty method of ODataModel

former_member514516
Participant
0 Kudos

Hello,

Been researching a lot but could not find anywhere.. How do I pass more than one key in the getProperty method of my ODataModel object?

My codes below result to undefined

oModelx.getProperty("/Order_Details('10248')")

oModelx.getProperty("/Order_Details(OrderID=10248,ProductID=11)")
oModelx.getProperty("/Order_Details(OrderID='10248',ProductID='11')")

I thought maybe because the Entity has 2 keys per its metadata.

I'd like to get the data using 2 properties as the selection criteria.

Thanks!

Michael

Accepted Solutions (1)

Accepted Solutions (1)

former_member514516
Participant
0 Kudos

I found the issue.. I had to read the EntitySet first using this code below.

oModelx.read(
                 "/Order_Details",
		 {
                       method: "GET",
	               success: function(oData2, oResponse) {
			//Create JSON Model
		       console.log("Success!");
                 },
		       error: function(oError) { console.log("Error!"); }
		});	

Then this code below started to work.

oModelx.getProperty("/Order_Details(OrderID=10248,ProductID=11)

Answers (0)