09-27-2011 11:57 AM
Below is my code snippet. What do I put in place of $key to get the value of a different field in the same entity?
in table terms account.accountid 1 to many accountproductrelationship.relationid
Thanks!
Norman
{
options: {
title: this.relatedItemsText,
list: true
},
as: [{
icon: 'content/images/icons/Company_24.png',
view: 'account_related',
label: 'Relationship',
where: function (entry) {
return String.format('id eq "{0}"', entry['$key'])
}
}]
}
09-27-2011 01:31 PM
If you look in argos-sdk in src/Detail.js and go through the request cycle it sets the response of the SData GET (de-serialized into an object) into this.entry.
So you can use whatever you set in the querySelect array in your view, plus any of the default ($) properties.
To view the actual SData response in Chrome, open the debugger (ctrl+shift+j) and click the Network tab. Look near the bottom for the GET request, select it and then click the sub-tab 'Response'. It will show the json object and with any json key you can use entry[key]. Screenshot attached.
Another option is to put a console.log(entry); above your return line to see the object and all it's properties (Chrome/FF with Firebug will enumerate it for you in the debugger).
09-28-2011 07:32 AM