Create a ribbon button in MSCRM to generate an output
In this tutorial I’ll take you through creating a button in Microsoft Dynamics CRM that will be placed on a ribbon and that you can link to an output from fDocs.
By creating your own customisations you can already achieve this functionality without extra tools, but to make life easier we are going to use the Visual Ribbon Editor, which is an open-source tool that lets you manage ribbons in MSCRM. If you haven’t yet got this tool, download it now from the link provided above.
- Open the Visual Ribbon editor and click the top-left icon to connect to your CRM platform.
- Use the “Open” button to select a suitable entity for your button to be attached to (i.e: quote/account).
- From the Ribbon Type, select the area you wish the button to be attached to, such as the form (the pop-up window that appears when you double click on a quote, or an account), or entities homepage.
- Click “Add Button” to add a button to your ribbon.
- Give the ID a suitable name, label, tooltip, and 16×16 and 32×32 icon of your choice.
- Under the “Action” tab, add an action to run a URL:
- The URL can be http://<yourservername>/fDGenerate.aspx or http://<yourservername>/fDSelect.aspx if you want to give the user the option to select their output format or enter additional entries that your DSD may require. This URL should be appended with ?fDTemplateFile=Folder\Template Name.docx which gives the location to your template, relative to the published templates root, such as http://myfSeriesserver/fDGenerate.aspx?fDTemplateFile=Quotations\Initial Quote.docx
- If you want to automatically pass extra user entry values your DSD requires, or additional fDocs parameters such as specify the output format (if you have set up PDF outputs for example), add them onto the URL, such as &fDFormat=pdf.
- Set the target of the URL to be a window popup or dialogue depending on your choice, and elect NOT to pass the parameters, but add your own parameter which matches the user entry required by the DSD. For example, if you have generated a quotation template, then you would likely need to add a “quoteid” parameter, which passes the GUID of the current entity on screen (the quote).
- If you only want the button to appear on certain conditions, use the display and enable rules to set these.
- Click the “Save” button at the top of the visual ribbon editor to submit your changes to MSCRM.
Now, when you go into your entity in CRM, you should see a button, which when clicked will open a window, direct to fDocs, and generate your output.