Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

unable to trigger the plugin which is called as global action on click of a ribbon button

(0) ShareShare
ReportReport
Posted on by 10

Hi Guys,

I have written a plugin code to set word template 

public void SetWordTemplate(IOrganizationService orgService, Entity docTemplate, string entityName, Guid recordId)
{
OrganizationRequest request = new OrganizationRequest("new_SetWordTemplate");
request["Target"] = new EntityReference(entityName, recordId);
request["SelectedTemplate"] = new EntityReference(docTemplate.LogicalName, docTemplate.Id);
var response = orgService.Execute(request);
}

and I am using a javascript function to call this plugin which is given below

function generateWordDocument()
{
    Process.callAction("new_SetWordTemplate",
        [
            {
                key: "Target",
                type: Process.Type.EntityReference,
                value: new Process.EntityReference(Xrm.Page.data.entity.getEntityName(), Xrm.Page.data.entity.getId())
            },
            {
                key: "SelectedTemplate",
                type: Process.Type.EntityReference,
                value: new Process.EntityReference("documenttemplate", "{974488A7-0A8D-ED11-81AB-000D3AC9C1A6}")
            }
        ],
       
    );
}
But On click of the ribbon button it is not triggering the plugin which is called as action.
It is getting hit on line 1 but no further progress. 
I need to attach the document template to notes in the record.
can anyone guide me to fix this issue? 
  • Naveen Ganeshe Profile Picture
    3,393 User Group Leader on at
    RE: unable to trigger the plugin which is called as global action on click of a ribbon button

    Hi,

    are you getting any errors in the console? Also, make sure "new_SetWordTemplate" action has been registered correctly in plugin registration tool.

  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: unable to trigger the plugin which is called as global action on click of a ribbon button

    Hi,

    Can you please add trace logs in your plugin.

    Check plugin run history under setting -   plug-in trace log

    Can you please show the plugin step you registered on your custom action

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Product updates

Dynamics 365 release plans