Hi Guys,
I have written a plugin code to set word template as shown below.
public void SetWordTemplate(IOrganizationService orgService, Entity docTemplate, string entityName, Guid recordId) { OrganizationRequest request = new OrganizationRequest("SetWordTemplate"); request["Target"] = new EntityReference(entityName, recordId); request["SelectedTemplate"] = new EntityReference(docTemplate.LogicalName, docTemplate.Id); var response = orgService.Execute(request); }
While debugging the plugin using plugin profiler, it is woking fine and no errors are detected. The document template is getting attached to the notes in the record.
I am calling this plugin in a global action and on click of a ribbon button, I am calling the javascript to call this custom action.
But if I stop profiling the plugin step and click on the ribbon button, javascript is called and it invokes the action but I get a pop up as follows.
The request SetWordTemplate cannot be invoked from the Sandbox.
Also, the document template is not getting attached to the notes in the record.
Can anybody guide me to solve this issue?
Any help is appreciated.
*This post is locked for comments