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
John L.John L. 

2 Questions regarding VisualForce Global Variables

I'm trying to use Global Variables from within JavaScript, with the !URLFOR() function, to control flow between VisualForce pages.

 

Question #1) How can I get addressibility to the SendEmail s-control which is standard on the "Accounts + Activity History + Send An Email" button? Initially I tried $SControl.SendEmail, but $SControl variables just access custom (user-defined) s-controls. I also tried $Action.Account.Activity.SendEmail, to no avail.

 

Question #2) The page editor is preventing me from referencing the JavaScript variable document.referrer within a !URLFOR() i.e.

 

    window.parent.location.href="{!URLFOR($Page.MyPage,[retURL=URLFOR("+document.referrer+")])}";

 

Thanks in advance for any help or insight you might be able to provide.

 

 

John L.

XactiumBenXactiumBen
If you look at the $Action global variable within a new Custom Link/Button you can use {!$Action.Activity.SendEmail}.  I'm unsure what parameters you need to pass into here to get this working but try experimenting by creating a test custom button.
John L.John L.
Alas, $Action.Activity.SendEmail is no good either. Any other thoughts?