Hopefully, you already know that s-Controls are being phased out at the end of 2009. Most of us haven’t worked with s-Controls, since Apex was released. With Apex and VisualForce, there’s very little that can’t be done in salesforce.com that we used to do with s-Controls.
The few things that are hard to do can usually be accomplished by using a custom button/link to run some javascript and then some javascript first then pass it off to Apex/VisualForce. A good example of this is a custom button on a related list. With s-Controls we could pass which records had the checkbox checked in the related list. When VisualForce came out, we lost this ability and forced the user to navigate to an additional page with the same list and check the boxes there.
There is a javascript workaround though, it involves having the custom button on the related list run some code that looks like this:
{!REQUIRESCRIPT("/soap/ajax/17.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/17.0/apex.js")}
var records = {!GETRECORDIDS($ObjectType.Lead)};
if ( records.length > 0 )
{
var success = sforce.apex.execute("ApexClassName" , "ApexMethodName",
{
listIds:records
}
);
window.location.href=window.location.href;
}
else
{
alert('Please select one or more records');
}
Have you migrated your s-Controls yet? (Don’t worry, your existing ones aren’t going anywhere yet, you just wont be able to create new ones).