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

code of popup doesn't work


since yesterday the code work properly and I saw the popup of url, but now it doesn't show me any popup

I want open popup with url every time if the stagename of opportunity is closed/won.

I have active the popup on chrome, ie , firefox.

What kind of problem is it ?




<apex:page standardController="opportunity" >
  <script src="/soap/ajax/10.0/connection.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/functions.js"></script>

if ('{!Opportunity.StageName}' == 'closed/won') {
var url1= ''




Not sure why you need "connection.js" and "function.js" in your page code. 


Also, {!Opportunity.StageName} is typically escaped to avoid any XSS,CSRF issues. You might want to try the following code to help trouble shoot the issue:



<apex:page standardController="opportunity" >
<script type="text/javascript">
var oppStage = '{!Opportunity.StageName}';
if ( oppStage == 'closed/won') {
var url1= ''




thanks, it works properly, maybe the SF has changed sometimes and my old java didn't work.


maybe I get the code from some demo on SF and I don't delete "connection.js" and "function.js".