You need to sign in to do that
Don't have an account?
Shweta Garg
window.open not working in javascript on custom button
Hi all,
I want to open a pdf on clicking custom button in another tab. I used Window.open method in onclick javascript.It was working fine but now I also need to increment a field also on clicking button . Here is the code sample.
But it is opening on the same tab. But customer wants to open a pdf in Another tab.
Window.open in not working when used with code (incrementing field).
Thanks for the help in advance.
Thanks,
Shweta
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} var ID = "{!Quote.Id}"; var quoteobj = new sforce.SObject("Quote"); quoteobj.Id = '{!Quote.Id}'; quoteobj.ZT_PDF_Version__c = {!Quote.ZT_PDF_Version__c } + 1; var res = sforce.connection.update([quoteobj]); //window.location.reload(); window.location = '/apex/Generate_PDF?id='+ID;
But it is opening on the same tab. But customer wants to open a pdf in Another tab.
Window.open in not working when used with code (incrementing field).
Thanks for the help in advance.
Thanks,
Shweta
I had commented this part of code.
Then only window.open is working. I am not getting why is it so.
Can you put alert statements after every lines of this commented code and see where it breaks?
May be line 3 of the above code need to be replaced with this.
Let me know how it goes.
Thanku guys for your help.