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
ClintHegneyClintHegney 

AppExchange "retrieve" API call

Is there something similar to the "retrieve" call in the AJAX tool kit? I am working on a project that will get all the products tied to an opportunity and then take he product ID from the query return and get the product code for each product and build a string that will be added to the end of the opportunity name. I know that I am going to have to iterate through the result from the query and for each product ID get the details of that product so I can grab the product code. Will I need to perform another query for each product ID so I can get the product's details or is there a method in the toolkit similar to the retrieve API call. In looking at the documentation in Eclipse I wasn't able to find a method that would do this.
bmfbmf
That would be the same call as documented in the API, with the exception of an optional forth parameter, the callback function (like all the other AJAX calls):
 
sObjects[] = sforceClient.retrieve(fieldList, objectType, idArray, callback [optional] )
 
fieldList is a list of fields to retrieve.
objectType is the API name for the object to retrieve.
idArray is the 15 or 18 character ID.
callback is the callback routine for async requests.
 
I hope this answers your question.
Connect ComputiConnect Computi
This is a start of a good example.  What is the idArray?  If I can get my code to work, I'll post it here as well.

Thanks,

Roy


So far only:

var fieldList = "AXCN_Resource_Name,AXCN_Resource_price";
sObjects[] = sforceClient.retrieve(fieldList, "AXCN_Resource", idArray);

Thanks,

Roy

DevAngelDevAngel
idArray is an array of strings.  When in doubt, try the parameters as described in the API doc.

Cheers.