​​​How to display a popup dialog to open a list/library?

Last Update: June 22, 2018

Here are the steps on how to display a popup dialog to open a SharePoint list/library when click on a Button control in the form.

  1. Open the form in design mode.
  2. Add the following controls in the form as follows:
    How to display a popup dialog to open a list library1.jpg
  3. Select the Button control.
  4. In the Rules pane, click on the Add icon to add a new rule, the Rule Manager dialog will open.
    How to auto-shifting Panel control in a form2.jpg
  5. Add a new rule as follows:
    A. Change the Rule Name as desired.
    B. Change the Rule Type to Action.
    C. Change the Event Type to onClick.
    D. In the Actionsection, type the following script:
    var options = { url: getWebServerRelativeURL() + '/intranet/Lists/Countries/NewForm.aspx?RootFolder=1', title: 'Countries', allowMaximize:true, showClose: true, width: 700, height: 350 };
    SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
    setValue(txtItemNo, getRepeaterRow(repeater3))
    E. Click on the Save button to save the rule.
    Note: You can use Assistance Panel to help you adding functions and related parameters, form variables and form controls to Conditions and/or Actions sections.
  6. Test the form by clicking on the Preview button in the View group.

Related Resources:
These resources may not reflect the same exact case steps.
https://www.youtube.com/embed/nzyJejxNJUI