You need to sign in to do that
Don't have an account?

Button functionality working on clikcing twice
{!REQUIRESCRIPT("/xdomain/xdomain.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/34/apex.js")}
{!REQUIRESCRIPT("/support/console/31.0/integration.js")}
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;
window.open(url,'_blank','toolbar=0,location=0,menubar=0');
}
else
{
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?
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/34/apex.js")}
{!REQUIRESCRIPT("/support/console/31.0/integration.js")}
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;
window.open(url,'_blank','toolbar=0,location=0,menubar=0');
}
else
{
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 ?