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
praveen kumar thotapraveen kumar thota 

Custom Button Onclick java script is failing in other sandboxes while working fine developer sandbox

I created a custom button for custom object by using Onclick execute javascript. it is working fine in my developer sandbox but failing in other sanbox.
When i click this custom button in other sandbox then Url in addressbar of browser changed to my developer sandbox and immediately redirected to login page of my developer sandbox.this is affecting deployment of my project.

i am pasting the java script code that i have written for this custom button

var url='/apex/newrequest?recordtype=smart1.0&rec.name={!conatct.name}'; 
if(typeOf(srcUp)=='Function'){ 
    srcUp(url); 
} 
else{ 
    window.open(url); 
}



This issue occured in final stage of deployment
Urgent solution required for this issue
Thanks in advance for helping out me in this issue
Scott HungScott Hung
I don't see anything wrong with the code excerpt except that your variable url is an absolute path (/apex...) and not relative.  What happens if you wndow.alert("url="+url); before calling your function?  Does it include the right URL?  
praveen kumar thotapraveen kumar thota
Thanks scott for Reply,

I found this issue is related to browser,all systems in network got corrupted by some malware.When i executed this in a desktop not in my network it worked fine then i came to know that this issue is related to browser but not with code.


Thanks once again for your reply.