web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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? 
I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    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

  • Naveen Ganeshe Profile Picture
    3,397 User Group Leader on at

    Hi,

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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans