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
jwhjwh 

WIL without output?

I would like to be able to provide a WIL on a page which invokes a Java servlet which causes some information to be updated on the page on which the WIL lives.  Ideally I would like the user to click the link and when the servlet finishes I would like the current page to rewrite.  Is there any way to make this happen?  For example, suppose I have a custom field on the Opportunities page that I want to update from some backend process.  I would like to have the user be able to enter information on the screen, click our link and then see some of our custom fields updated with values derived from the backend.

Is this doable?

Thanks.

DevAngelDevAngel

Hi jwh,

I'm not sure if this is what you want, but, here goes.  You can create a WIL that passes info in the query string part of the url.  To be able to refresh the window that the link is on, you will want to include in the query string the opportunity detail link merge field {!Opportunity_Link}.  You can create a new WIL on your opp that looks like this:

http://localhost/webtocase.html?opener={!Opportunity_Link}

I've configured mine to open a new window.  The link opens a localhost file that contains a button and some javascript.  The java script parses out the opportunity link when the page loads.  This you can keep around for when your servlet is finished.  The button just resets the window.opener.location property, which causes the salesforce.com page to reload and then closes the WIL window.

<html>
<head>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<script language="javascript">
<!--
var refreshLink = window.document.location.href;;
refreshLink = refreshLink.substring(refreshLink.indexOf("=")+1)

function Button1_onclick() {
 window.opener.location = unescape(refreshLink);
 window.close();
}
//-->
</script>
<body>
 <INPUT id="Button1" type="button" value="Refresh Opener and Close" name="Button1" onclick="return Button1_onclick()">
</body>
</html>