Everybody is quite familiar with the Add or Find Person functionality under Lead. Here we get a link under Person details saying Add or Find Person. Clicking this link will open a pop up to fill in the details of the person and new person is created in no time. As soon as we save the data the screen redirects back to summary page with Select Person button. Clicking this button closes the pop up window and sets the person created under Lead person details.
Now here the hitch is, when we open popup window in edit mode and on save of the details set the value on parent page, it’s quite easy task as here we can use the below script to refer parent window objects.
Now if I have a page in edit mode which redirects to summary page after saving details, the parent of the page i.e. an opener window is lost and the editable screen becomes new parent. Due to this we won’t be able to get the object of the page from where we opened this window. Now how do we set the value of field on parent window then? Well, you just need to change above line of code to following.
Using opener will get you the object of opener page wherever you redirect in your popup window. The same phenomenon explained above for pop up window also works for IFRAMES as they are also the child windows and work in similar manner.