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

when i click button, it is redirecting another page, but that page is opened in a same page
Generally, we have links on opportunity header to check count of line item or etc and i am trying to create Opportunity line item from opportunity header link, but it is opening opportunity line item insert page in header page itself, i mean please see my screen shot.
actually i want to show line item insert page, when user click serivce line item button on Opportunity header links
Code, I have written in Button.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var opp = new sforce.SObject("Opportunity");
opp.Name = "{!Opportunity.Name}";
if('{! Opportunity.Count_Closure__c}' == 0)
{
window.location.href='/apex/OppClosureDeclaration?CF00Ne0000000sJl7=opp.Name&CF00Ne0000000sJl7_lkid={!Opportunity.Id}&scontrolCaching=1&retURL=%2F{!Opportunity.Id}&sfdc.override=1';
}else
alert('OPPORTUNITY CLOSURE IS ALREADY SUBMITTED');

actually i want to show line item insert page, when user click serivce line item button on Opportunity header links
Code, I have written in Button.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var opp = new sforce.SObject("Opportunity");
opp.Name = "{!Opportunity.Name}";
if('{! Opportunity.Count_Closure__c}' == 0)
{
window.location.href='/apex/OppClosureDeclaration?CF00Ne0000000sJl7=opp.Name&CF00Ne0000000sJl7_lkid={!Opportunity.Id}&scontrolCaching=1&retURL=%2F{!Opportunity.Id}&sfdc.override=1';
}else
alert('OPPORTUNITY CLOSURE IS ALREADY SUBMITTED');
instead of
window.location.href
All Answers
instead of
window.location.href
Thanks for your reply.