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
Adrian SameliAdrian Sameli 

How to call standard "new child record" window using JavaScript in VisualForce page

I'm trying to call the standard form to create a new related object in an overlay window, when loading a specific object detail page. That's how I would call the function:

<script> var previousOnload = window.onload; window.onload = function() { if (previousOnload) { previousOnload(); } alert('new related object...'); } </script>

How can I find the right function to call for any standard buttons? Like for example the "new" action on any related list? The action URL looks like this:


Thank you very much for your help.

VinayVinay (Salesforce Developers) 
Hi Adrian,

Using URL hack you can pre-populate field values but not create any popup on when onload.