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
gbs10750gbs10750 

SControl Merge Fields in Homepage

Hi,
 
I'm trying to retrieve the url of an s-control from a homepage component using the s-control merge field
Below is the javascript:
 
function showQuoteWindow()
{
        var scontrolid = "{!$SControl.TF__Online_Company_Profile}";
       alert("scontrolid : " + scontrolid);
}
It doesn't seem to resolve the s-control merge field.
 
I'm able to retrieve the url when the merge field is included in a s-control called from the accounts detail page.
 
Thanks in advance.
rockchick322004rockchick322004
Does the {!$SControl.TF__Online_Company_Profile} not resolve at all, or does it resolve to blank?  If it doesn't resolve at all, then it might be the quotes around it (the server doesn't recognize it as a merge field); if it resolves to blank, then maybe you need to use it within the URLFOR() function.
gbs10750gbs10750
Hi,
 
I created a detail page button for accounts that executes the javascript below:
 
-----------------
var scontrolid = "{!URLFOR($SControl.Thomson_Online_Company_Profile)}";
alert("scontrolid : " + scontrolid);
able to resolve merge field to "/servlet/servlet.Integration?lid=01N700000000y4P&enc=UTF-8&ic=1"
 
------------------
var scontrolid = "{!$SControl.TF__Thomson_Online_Company_Profile}";
alert("scontrolid : " + scontrolid);
able to resolve merge field to "/servlet/servlet.Integration?lid=01N700000000y4P&eid=__ENTITY_ID__&enc=UTF-8&ic=1"
------------------
running the same javascripts above in a home page component results to
 
1.  {!URLFOR($SControl.Thomson_Online_Company_Profile)}
2.  {!$SControl.TF__Thomson_Online_Company_Profile}
 
Are there any limititations in using merge fields in a home page component ? any workarounds ?
 
thanks again.
 
rockchick322004rockchick322004
The HTML type of home page component does not know about merge fields and formula functions, it is for displaying static content like company notices and such.

There is a hack-around that displays an sControl on the home page, and in the sControl, the merge fields and formula functions should resolve.  Are you using the hack-around?
gbs10750gbs10750
Thanks mscotton.  I'll try your suggestion and I'm using the hack around to invoke the s-control from a home page component
AlexCRMmanagerAlexCRMmanager
What is the "hack around" to invoke the s-control from a home page component?
gbs10750gbs10750
Hi Alex, I was invoking the scontrol via its url: (see value for src below)
SunnyCarterSunnyCarter
Hi there, I'm afraid I cannot understand how to find the url for an s-control from the last post.  This automatically refreshes my page to an unknown page.

Can you let me know how to find the url of an S-Control so that it renders in a Home Page Component.  My aim in the end is to be able to retrieve values from merge fields in an HTML Home Page Component.  It sounds like including an S-Control which knows these values is the way, but I don't know how to put the S-Control in the component.

Thanks

Sunny