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
truetrue 

Scontrol Link to custom tab

Hi,

I need to do following steps in order to pass parameter to custom tab:

a>Creation of  a scontrol object- How can I create a sontrol object using javascript or any other tool? I am using a developer edition. How can I download office toolkit?

b>I found some example for javascipt

<SCRIPT>
function setVal() {
   SchedTasks.SessionID="{!API_Session_ID}";
   SchedTasks.ServerURL="{!API_Enterprise_Server_URL}";
   SchedTasks.UserID="{!User_ID}";
}
</SCRIPT>
<BODY onload="setVal();">

In my case I need to pass companyname as a parameter or companyid(custom lead field). I am using partner 5.0 wsdl. How can I use the merge field in order to use any of the lead fields? Is it possible to use the same script?

 

Please advice, is this is right aproach. If possible, please answer all the queries.

 

Thanks,

 

DevAngelDevAngel

To create an scontrol you should use the AJAX Toolkit Beta2 that can be found here:

http://blog.sforce.com/sforce/2005/07/ajax_toolkit.html.  Include in your html for the scontrol a script tag that references this url as the source:

https://www.sforce.com/ajax/beta2/sforceclient.js

The fields are passed to an scontrol by way of merging the field data into the script at the time the control is rendered.  In your snippet you have shown some merge fields that are API field values, you will want to use Lead field values.

for example:

<SCRIPT>
   var companyName = '{!CompanyName__c}';
</SCRIPT>

The assumption above is that your custom field is named CompanyName__c

Message Edited by DevAngel on 09-27-2005 10:15 AM

truetrue

Hello Dave,

Thanks for the response.

Let me give you the detail information what I have done so far:

1>created the custom tab, say "testtab" from the sforce application.

2>created the custom scontrol "stest" from the salesforce application.

3>Added the html script on the custom scontrol "html body".

<SCRIPT>
function setVal() {
   SchedTasks.SessionID="{!API_Session_ID}";
 var x = {!Lead_Company};
var companyid = {!Companyid__c};

   }
</SCRIPT>
<html>
<head>
<script language="javascript" src="https://www.sforce.com/ajax/beta2/sforceclient.js"
   type="text/javascript">
</script>

</head>

<BODY onload="setVal();">

</html>

 

When I am trying to save this scontrol, it is giving me error "Bad Link Definition "

I want to create a scontrol which can be used from the custom tab. Main purpose of custom tab is to open the new site let's say http://www.testmysite.com?companyid=companyid within the same salesforce application frame window.

one more question, I have no idea about all this parameter  "  SchedTasks.SessionID". If possible give me some idea . Thanks!!!

In my html script how can I add my custom site link http://www.testmysite.com and merge the companyid (custom lead field).

 

Thanks,

True

 

 

 

 

DevAngelDevAngel

Ok, If all you want to do is embed your site in a custom tab and pass a parameter on the url, you can do this easily without an scontrol.

Create a new Web Tab and when you get to the tab type step, select URL.  You can then build the approriate url for you site and add merge fields as required.

That's all there is to it.

truetrue

Dave,

Thanks for your reply.

Hey let me rephrase my requirement.

I need to the link from outside let say from email. It will directly go to one of the custom tab.

Reads the parameter from the link, let's say if I am passing companyid=1234, custom tab is pointing to some link. let's say http://www.test.com"

than automatically the tab should render the links with companyid=1234

Is it possible?

Please advice!!! If yes, what is the steps do work this out.

 

Thanks!!!

true