The [Create Document]-button provides access to the DocumentsCorePack dialog from the CommandBar. Upon installation, the button is added for most entities on default. However, if you want to rename the button or if you need to add it to a custom entity you have to create the button manually.
Please note: The description applies to Dynamics 365 & Model-driven apps Online only. For on-Premise deployments, you will have to use the RibbonWorkBench.
Step-by-Step description of how to add the button:
Step 1: In ❶ Power Apps navigate on the left bar to ❷ “Apps”. In this example, the button should appear in the ❸ “Customer Service workspace” app (Make sure it is the environment you are working with). Hit the three little dots and select the ❹ “Edit”-function and then ❺ “Edit in preview”.
Figure 1: Power Apps – Edit-function
Step 2: This site opens. On the left sidebar, all entities are shown. Now select the entity, you want to edit. In this example, it is ❶ “Account”. Open the ❷ “Edit command bar (preview)”.
Figure 2: Power App – Entity overview
Step 3: The “Edit command bar for Accounts” opens. On this site you can decide if you want to edit in the “Main grid”, the “Main form”, a “Subgrid view” or an “Associated view”. In this example it is the “Main form”. Press [Edit] to continue.
Figure 3: Edit command bar for Accounts
Step 4: This overview is displayed. To create a new button you have to add a ❶ “New command”. Set on the right side the attributes for the button, like
❷ Label: name it as you like
❸ Icon: optional
❹ Action: Run Javascript
❺ Library: select ptm_globalambutton.min.js
❻ Function name: ptm_openLookupDlg
❼ Visibility: Show
❽ “Save and Publish”
Figure 4: Set attributes for your button
Return to your Dynamics 365. Refresh the page and check, if you can see your newly created button in your entity like in Figure 5. Magic, isn´t it?
Figure 5: Result – newly created button
That´s it! We appreciate your feedback. Please share your thoughts by sending an email to support@mscrm-addons.com.