Skip to main content

Notifications

Announcements

No record found.

Open document on click of button in D365 CRM using JavaScript

Community Member Profile Picture Community Member Microsoft Employee

In this blog we will see how we can open a PDF document on click of button from a record in CRM

Let say we have User Guide button on Lead Entity and on click of User Guide button, a PDF document which is User Guide document should be open in next tab.

Solution

  1. Create a solution and add lead entity only.

Then open the same solution in XRM Toolbox – Ribbon Workbench

2. Create/Upload user guide document on SharePoint and Copy Document URL by clicking Share Document icon.
3. Create a WebResource with below code
 var openUserGuide =
{
   //openUserGuide.userGuide
userGuide: function () {
    "use strict";
    Xrm.Navigation.openUrl("https://sinerleak.sharepoint.com/:b:/s/SingerLewak/EaQO2OWjWA1BnHFCCENV-6EBDkILbg3EfPSFLEu-KCeraw?e=ofVyVB");
    }
} 

4. Add action to command and Publish the solution from XRM Toolbox

Output –

The post Open document on click of button in D365 CRM using JavaScript appeared first on.


This was originally posted here.

Comments

*This post is locked for comments