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
Varun AnnadataVarun Annadata 

Button functionality working on clikcing twice

var status='{!Program_Member_MVN__c.Status_MVN__c}'; 
var PmId='{!JSENCODE(Program_Member_MVN__c.Id)}'; 
var url; 
if (sforce.console.isInConsole()) { 
if(status == 'On Therapy') 

url = "/apex/Milestone_skip?id="+PmId;,'_blank','toolbar=0,location=0,menubar=0'); 


alert("Please Check The Patient Status"); 


This is my Javascript code but the functionality is working only if i click the button twice?Why is this happening?

Could you please post th button code ?
Varun AnnadataVarun Annadata
The above java script is what i wrote in button for onclick java script