+ Start a Discussion
meenaSFmeenaSF 

Passing Parameters to S-Control

Hi,
 
I am starting to learn s-control on the job. 
 
I created a S-control ( as url, an external .Net application ).  I have two questions.
 
1. How to attatch it to a custom button ?  I am able to override a standard button. But I do not want that. I want to create new custome button and call the s-control on click of that button. Is this feature available now  in Enterprise edition?
 
2.  How to pass parameters from salesforce screen to this s-control when the user clicks on it ? I want to pass IDs of the case screen , when the user clicks on the custom button or link ? Can someone please help me with a sample code snippet,
 
 would really appreciate your answers to the questions above  !!
 
 
Thanks,
Meena
MattLMattL
For creating the custom button, that is a relatively simple procedure. Simply navigate to the "Buttons and Links" section of the object you are editing under "Setup". Go to "New" under "Custom Buttons and Links", and specify that it is a "Detail Page Button". The content source will be "Custom S-control". Then go to the Page Layout of the object, click on the "Detail Page Buttons" area, and hit "Edit Properties". Add your button, and save the layout.

As for getting the IDs you wanted... I don't have any background with .NET, but I would assume there is a way to query an external Javascript function? The method I use when I code Adobe Flex is to create a returning function in the javascript of the S-control. Something simple, like:

Code:
<script language="JavaScript">
function getID() {
    return("{!Account.Id}");
}
</script> 

 Then I use Flex's library of ExternalInterface to call it. I would assume .NET would have a similar package.

HTH.