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
GregoryGregory 

Need help with $ObjectType and GetRecordIDs

I found an example s-control at http://blogs.salesforce.com/features/files/salesforce_useful_scontrols.pdf.  The example is:
  1. Define a custom list button with the following attributes:
  • Display Type is "List Button"
  • Behavior is "Execute JavaScript"
  • Content Source is "OnClick JavaScript"
  • Use the following sample code:
 idArray = {!GETRECORDIDS($ObjectType.Contact)};
 alert("The Ids you have selected are: "+idArray);
 Note: This example is for contacts. Change the object type for a different type of record.
 
I'm trying to get a list of custom objects selected on a related list.   I'm looking at a 'Requsition' details page, with a related list of 'Candidates'.   I'd like to be able to select a number of the candidate objects on the related list and then click on the s-control to loop through each of the ones selected.
 
The example says to 'Change the object type for a different type of record'.   I've tried my object names of Candidates and Requisition, but always get a syntax error of "Error: Field Candidate does not exist. Check spelling."
 
How can I get the GETRECORDIDS function to work?   Note I'm using Team Edition that doesn't have the AJAX API.
 
Thanks,
Gregory
GregoryGregory
I tried idArray = {!GETRECORDIDS($ObjectType.Candidates_cc)};  and the example now works.
 
Now for a follow-on question: is it possible for each one of the Candidate IDs, to get custom field data from each object?  I'd like be able to get the email address for each contact (custom field on a Candidate), built up a string with each of the emails separated by commans, and then call the "Send An Email" activity and pass the list of emails to the "To:" field of the email activity form.   
 
I'm guessing that with the lack of the API in Team Edition, I may not be able to dereference each of the object ids to get their email addresses.   If not, can someone at least help me with a simple javascript to loop through the IDs, and call a URL for each one?   Is it possible to automatically close the window for each of one of those URLs?
 
Thanks,
Gregory
albatrossalbatross

Did you ever resolve the issue of getting the email address? I am having a similar situation. I need the email addresses but do not have the AJAX API.

Would appreciate if you could pass on the solution - if you found one.

 

Thanks

Sharad