Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Bronze Super Contributor
Posts: 192
Registered: ‎07-17-2011

Mobile client where clause, not using default id

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'])               

      }               

   }]           

}

Highlighted
Bronze Contributor
Posts: 95
Registered: ‎07-11-2011

Re: Mobile client where clause, not using default id

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).

 

 

Highlighted
Bronze Super Contributor
Posts: 192
Registered: ‎07-17-2011

Re: Mobile client where clause, not using default id

Thanks you so much! Worked like a charm!