0

It is possible to open a popup to create a new object by clicking the "new object" button that is on related list?

enter image description here

I think that I could add a custom button calling some javascript to "window.open(...". But, I would like to know if it is possible using some SF functionality out of the box.

1

This is either going to be a JavaScript button or Visualforce button with Apex behind it. The only other out-of-the-box option is a URL, but this wouldn't give you a popup.

0

You can try following approach:

  1. Create a custom button "New Invoice Item" on Invoice Item object and add it to related-list.
  2. Override "view" action of your main object (whose detail you are showing here) with a VF page. On this VF page, you can use <apex:detail> to show all details and related-list.
  3. On this VF page, write javascript code to handle onclick event and open pop-up.
  4. Edit "New Invoice Item" button to call event handler (written in step 3).
  • Thx, but why should I use a VF page to add a javascript function instead write the entire Javascript within the custom button? – Martin Borthiry May 10 '13 at 11:40
0

To display another visualforce page as a popup follow bellow steps if it is a related button (e.g. opportunity is parent and contract is a child)

  1. create a button in "contract -> buttons and links", select the link button behavior "execute javascript" and Content Source is "onclick javascript". Set the link like this:
    window.open('/apex/PageName?Param1='+'{! Opportunity.Id }','mywindow','width=600,height=200');
  2. write a vf page Pagename.
  3. Add that button to the opportunity related list contracts
  4. edit the opportunity layout and go to related list contract
  5. press rench and in buttons section move the button to selected buttons section. save and open any opportunity record go to contract related section you will find the button which you added. press it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.