Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removes the platform-default handlers for a Microsoft 365 Copilot action.
Syntax
Xrm.Copilot.removeDefaultActionHandlers(actionId).then(successCallback, errorCallback);
Parameters
| Parameter Name | Type | Required | Description |
|---|---|---|---|
actionId |
string | Yes | The action ID whose defaults you want to remove. Must be one of the built-in action IDs defined in addActionHandler. |
successCallback |
Function | Yes | A function to call when the operation succeeds. |
errorCallback |
Function | Yes | A function to call when the operation fails. |
Return Value
Type: Promise<void>
Remarks
This method doesn't affect custom handlers registered through addActionHandler. To restore the default handlers, use addDefaultActionHandlers. If Microsoft 365 Copilot isn't enabled, this method does nothing.
Example
// Replace default record navigation with custom behavior
await Xrm.Copilot.removeDefaultActionHandlers("MS.PA.CopilotChat.OpenRecord");
await Xrm.Copilot.addActionHandler("MS.PA.CopilotChat.OpenRecord", async ({ entity, recordId }) => {
// custom implementation
});