+ Start a Discussion

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?

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

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?

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.

Use the update call.  There is documentation on the AppExchange Developer Network website that explains how to use the API.
Thanks was able to solve it.
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?

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