How to Embed a Popdock Widget in Dynamics 365 CE/CRM
With the use of a Popdock widget you can integrate a Popdock list or multiple lists directly into your Dynamics 365 Customer Engagement user interface as an Iframe. The following example is a common scenario we see for embedding widgets in CE.
A Popdock widget will need to be created prior to following these steps because you will need the widget URL. Click Here to learn how to create a Popdock widget.
A sample solution with a widget can be downloaded here.
Adding a Popdock Tab:
Step 1. Click the gear icon at the top right next to your profile icon, then select "Advanced Settings".
Step 2. In the top navigation bar go to Settings > Customization > Customizations > Customize the System
Step 3. Select > Entities > Account (or any other entity you want to use) > Forms > Account (Or any form you want to modify)
Step 4. Click the tab you want the Popdock tab to come after, and go to the Insert tab in the Toolbar and click "One Column".
Step 5. Give the tab a Name and Label
Step 6. Select the section on the new Tab > Add IFRAME from the Insert menu
Step 7. Enter the below settings
- Name: Enter "IFRAME_Popdock"
- URL: The URL for your widget as generated in Popdock
- Display label on the Form: False
- Restrict cross-frame scripting: False
Step 8. Go to the Formatting tab and enter the below settings
- Number of Rows: 14
- Automatically expand to use available space: True
- Scrolling: Never
- Display border: False
Step 9. Click Save on the Iframe window, then Save and Publish form
Step 10. In another window open the Account form and validate the Iframe is now embedded and showing data.
If you need to filter the widget to only show records for certain data, continue below. If you don't need to filter the data in the widget, you can stop here.
Adding Filter Parameters:
Step 3. Click Web Resources > and create a new Web Resource > Give the Web Resource a name and set the type to "Script (JScript)"
Step 4. Click "Text Editor" and enter the script to apply the parameter filter based on a form field.
- If you want to filter with a different CRM field, replace the technical name on line 5 from "accountnumber" to your field.
- If your Iframe has a different name, replace the Iframe name on line 7 from "IFRAME_Popdock" to your Iframe name.
- If your parameter in Popdock has a different name, replace the parameter name on line 11 from "customer_number" to your parameter name.
Step 5. Click the "Save" button, then "Publish"
Step 6. Open the form with the Iframe > Open Form Properties.
Step 7. Add a new Form Library by clicking "Add" and looking up your Web Resource.
Step 8. In the Event Handlers Section on the Control "Form" and Event "OnLoad" click add and select the following.
- Library: Your Web Resource
- Function: The name of your function in the JaveScript Web Resource
- Enabled: True
- Pass execution context: True
Step 9. Click Save and Publish on the form.
Step 10. In a new window open the Account form and validate the Iframe is now embedded and filtered based on your field.