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
nrwingnrwing 

Prevent Double Tabbing during Custom New Button URL click

I have a related list button for a custom object that appears to basically work, however it creates a new window inside the current one.

Also, upon saving it does not refresh the opportunity detail page (to which it is related) therefore showing the new record that was recently created.

 

/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}

 

If I rewrite as shown below , which is the help I have been able to locate, I get a cross-site scripting error/warning...... Any help on this one....I have exhausted anything I can find.....

 

<script language="Javascript"> function redirect(){ parent.frames.locations.replace('/a05/e?CF00N40000001jSgT={!Opportunity.Name}&00N40000001jXi0={!Opportunity.Market__c}&CF00N40000001jSgT_lkid={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}&saveURL=%2F{!Opportunity.Id}'); } redirect(); </script>



Message Edited by nrwing on 08-13-2008 01:16 PM
SunilSunil

Use the following line after saving the record : -

opener.location.replace("/{!Opportunity.Id}");

kevinedelmannkevinedelmann
It sounds like it may be a setting on the custom button page. 

Check the Behavior field and set it to "Display in existing window without sidebar or header"

This will open the new page just like when you edit/more to another object.
nrwingnrwing
Yep, you are right....I just tried that recently.....I feel kind of "duh" like, though I had thought, from some of the other things I had read, that you still needed to do something different in the scripting.  I think it is working now though. 
 
Thanks,
 
N