Fix DeleteAsyncOperation flag always defaulting to true when false in database
The CommandAddCrmPluginRegistration command only added DeleteAsyncOperation = true when the database value was true, but omitted it when false. Since CrmPluginRegistrationAttribute.DeleteAsyncOperation defaults to true, plugins with asyncautodelete = false in the database incorrectly got DeleteAsyncOperation = true in generated code.
Changes
- Always emit
DeleteAsyncOperationwith explicit boolean value from database - Extract
asyncautodeleteto variable for clarity
// Before: only added when true, otherwise relied on incorrect default
if (row.GetAttributeValue<bool>("asyncautodelete"))
sb.Append(", DeleteAsyncOperation = true");
// After: always emit explicit value
var asyncautodelete = row.GetAttributeValue<bool>("asyncautodelete");
sb.Append($", DeleteAsyncOperation = {asyncautodelete.ToString().ToLower()}");
This aligns with how TaskServer.cs handles the flag (line 1440) and ensures generated plugin registration attributes accurately reflect CRM configuration.
Original prompt
this file https://github.com/phuocle/Dynamics-Crm-DevKit/blob/v4/v4%2FDynamicsCrm.DevKit%2FCommands%2FCommandAddCrmPluginRegistration.cs
is it check add DeleteAsyncOperation flag. if not pls fix and add
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
@copilot continue improve check if class is plugin type custom action, custom api ? Is it add like plugin or workflow. You need double check TaskServer.cs for a lot of deployment task for: plugin, workflow, custom action, custom api, data provider to understand the idea that you can add CrmPluginRegistration attribute