function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mousetrapmousetrap 

SOQL Reference Field Issue

Can anyone tell me why the following statement will return the Owner.Name when using a query tool such as APEX Explorer, but when embedded in a S-control fails and hangs? BTW, Owner.Name is a field listed under the OwnerId reference field in the Opportunities table.
 
var showFields = new Array('Owner.Name','AccountId', 'Name','StageName', 'ForecastCategory', 'CloseDate', 'Amount', 'Id');
var queryStr = "select "+showFields.join(", ")+" from opportunity where isclosed = false";
 
TIA, mousetrap
SuperfellSuperfell
Are you using the new ajax toolkit in your s-control, or the old beta one ?
mousetrapmousetrap

The beta3.3 - did I mess up?

mousetrap

SuperfellSuperfell
the beta is for an api version that was before SOQL-R, what's probably hapening is that the query call is throwing an error, and that's why your callback function is not getting called. You really should move to the production ajax toolkit.
mousetrapmousetrap
Seems like a plan: is it just a case of changing the reference:
 
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
If there's more to it, would there be a reference document around detailing the process?
 
Thanks, mousetrap
 
mousetrapmousetrap
Ah, I found the reference documentation for migrating to v9.0 - thanks for the help!
 
mousetrap
SuperfellSuperfell
There's a section in the ajax toolkit docs that covers migration from the beta toolkit.