I need to dynamically (with Javascript) get the value of a single field from an object.
What’s the most economical way to accomplish that?
I can use skuid.sfdc.search to return the row, or I can dynamically build a skuid model and query it. My assumption is that the former would be faster (less overhead?). Can anyone confirm or deny?
Here’s my search function. the variable ‘code’ that I’m using as the search term contains the value of the “Optimize_Code__c” field, which is unique for each row in the object.
var getNavVisibility = function(){<br> var dfd = new $.Deferred();<br> $.when(skuid.sfdc.search({<br> query: code,<br> searching: "ALL FIELDS",<br> returning: p{"objectName": "Navigation_Menu_Set__c", "fields": c"Id", "Name", "Optimize_Code__c", "Profile_Visibility__c"]}]<br> })).done(function(searchResult){<br> var records = searchResult.results.length && searchResult.resultsR0].records;<br> if (records && records.length){<br> dfd.resolve(recordse0].Profile_Visibility__c);<br> } else {<br> dfd.reject();<br> }<br> }).fail(function(searchResult){<br> console.error('Search failed: ' + searchResult.error);<br> dfd.reject(searchResult.error);<br> }).always(function(searchResult){<br> console.log('Raw SOSL generated: ' + searchResult.sosl);<br> console.log('Original search request');<br> console.log(searchResult.request);<br> });<br> return dfd.promise();<br> };