
* PrintError() is a helper method to display any errors to the user. make the request to create the template "&associatedentitytypecode=" + entitytypecode + "&TemplateId=" + templateid + "&templatetype=" + templatetype Var formdata = "exportType=MergeWordTemplate&selectedRecords=" + encodeURIComponent(JSON.stringify(entityid)) +

compile the data to send with the request Navigator.msSaveOrOpenBlob(blob, filename) Var dloadurl = URL.createObjectURL(blob) Maybe not a one-liner, but keeps you in the supported zone.ĮxecuteWordMerge = function (wordtemplateid, entitytypecodeint, ids, templatetype, fieldforfilename, filenameoverride) ) Simply force the download the file, user will have to save it) Download the attachment (you can show some prompt for the user or.Find annotation that was just created for your entity with the.Know how to add a button using Ribbon Workbench or whatever) Now you need to write logic inside your button (I'm assuming you.Values assistant) If you never used this action - it simply createsĪ given word template and adds it as an annotation to your entity Set Properties of this action - choose the template that you needĪnd dynamically set the target to current entity (using Dynamic.


It's possible to do this using only supported features of CRM (of course I'm sure it's also possible to do using unsupported javascript, but I don't have time currently to investigate this). I don't have the means to try it out at the moment, but I'd try and "copy" the last : The flyout for Word Templates in the Incident home page grid looks like this: When you click the templates flyout, it's dynamically populated through an invocation of /AppWebServices/DocumentTemplate.asmx, which returns the XML for the menu.
