Skip to content

Fix DeleteAsyncOperation flag always defaulting to true when false in database#131

Closed
Copilot wants to merge 2 commits into
v4from
copilot/fix-add-deleteasyncoperation-flag
Closed

Fix DeleteAsyncOperation flag always defaulting to true when false in database#131
Copilot wants to merge 2 commits into
v4from
copilot/fix-add-deleteasyncoperation-flag

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 18, 2025

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 DeleteAsyncOperation with explicit boolean value from database
  • Extract asyncautodelete to 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.

Co-authored-by: phuocle <479729+phuocle@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix to check and add DeleteAsyncOperation flag Fix DeleteAsyncOperation flag always defaulting to true when false in database Dec 18, 2025
Copilot AI requested a review from phuocle December 18, 2025 14:08
@phuocle
Copy link
Copy Markdown
Owner

phuocle commented Dec 18, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants