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
jacqulinjacqulin 

Use of sforce.connection.retrieve

Hi All. I would like to know where does "sforce.connection.retrieve" gets the values from?
Is this value retrieved from the excel - connector?
The reason behind this is I have an s-control that checks whether two values are equal and update if they are not equal.
One of these value is the one retrieved using "sforce.connection.retrieve".
So, need to update the value.
It would be much helpful if I can get inputs from anyone. Below is the sample code.
var accrecord = sforce.connection.retrieve("BillingCity,BillingCountry,BillingState,BillingStreet,BillingPostalCode,ShippingCity,ShippingCountry,ShippingState,ShippingStreet, ShippingPostalCode", "Account",[rfqaccId])[0];

Thanks!

werewolfwerewolf
Retrieve gets its values from Salesforce.com same as any of the other query functions.  The Excel connector has nothing to do with it.

result = sforce.connection.retrieve("Name,Phone", "Account", ['0013000000GmQId']);

will give you the exact same results as

result = sforce.connection.query("Select Name,Phone From Account Where Id='0013000000GmQId'");
jacqulinjacqulin

Thanks for the update!

Can you please tel me how to update the value of a single record using s-control.?

For Eg: I want to update the address for the record ID ' 005864'

werewolfwerewolf
See the update examples on this page:

http://www.salesforce.com/us/developer/docs/ajax/Content/sforce_api_ajax_more_samples.htm#kanchor36

Which is from the AJAX Toolkit Developer's Guide.