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
FinTechFinTech 

How do you pass an ID to a sControl?

How do you pass an ID to an sControl? I'm trying to figure out a way to know who the calling contact page is when invoking my sControl?

In a typical URL submit you pass the id via the url (ie. www.salesforce.com?id=[id]])...Is there a way to do this? I just need to know who the contact is that called the sControl?

hELP!
Doug ChasmanDoug Chasman
If the info being passed in can be derived solely from merge fields (in this case perhaps it can be) and you want the "subject" of the target scontrol to be the source object. If you really only want the source contact's ID and  wish to have access to merge fields for an entirely different target object + some arbitrary data from the target you can accomplish that today using a combo of s-controls and the ajax toolkit.

Now the good news: this is a highly requested feature that has been implemented in the next major salesforce release (feature is already baked in). Basically, you will be able to get the value of query params /or form fields using the new $Request object, e.g.:

var id = '{! $Request.myQueryParam }';
alert('You passed in ' + id);

 

Message Edited by Doug Chasman on 08-30-2006 08:18 AM

FinTechFinTech
Maybe you can answer this one:

I want to update a checkbox on the record. I have a function in javascript that I want to write. Is there anyway to just update the record?
The_FoxThe_Fox
Hello,

Maybe I am dumb but the Merge Fields are there for that like {¨!Contact_Id} just check the exact typo and you will get your Contact ID otherwise there is anothe possibility but it is a bit more complicated.

REgards
DevAngelDevAngel
Use the update call.  There is documentation on the AppExchange Developer Network website that explains how to use the API.
FinTechFinTech
Thanks was able to solve it.
neutronrronneutronrron
Can the update call (or any api call for that matter) be used in an s-control on a SalesForce.com Professional account?   Or does the account have to be Enterprise level or higher?

Thanks,
Ron
Ron HessRon Hess
Enterprise or you may be able to purchase the API for your Prof edition.