Redirect.html

Image:cookbook.jpg

Force.com Cookbook Sample Code
Chapter 7: Customizing Buttons and Links - Redirecting a User to an Edit, Detail, or List Page

To download all the code samples, access the Cookbook. - Image:Key_icon.gif


This s-Control is part of an example that shows how to create a new button that executes logic written in javascript.

<!--
  Force.com Cookbook Sample Code
  Chapter 7: Customizing Buttons and Links
  "Redirecting a User to an Edit, Detail, or List Page"
 
  This s-control shows how to use the $Action merge variable in a 
  URLFOR() function to generate a redirect link.
 
  Sample code provided by salesforce.com. All rights reserved.
-->
 
<html>
<head>
</head>
<body>
<script type="text/javascript">
            var newURL = "{!URLFOR($Action.Account.Edit, Account.Id, null, false)}";
            window.parent.location.replace(newURL);
</script>
</body>
</html>

Sample code provided by salesforce.com. All rights reserved.