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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

msdyn_SuggestPrimaryForMergeAction returns error

(0) ShareShare
ReportReport
Posted on by 8

 

Hay Everyone,

I'm building a Power Automate flow that should automatically merge duplicate accounts in Dynamics 365.
I'm calling msdyn_SuggestPrimaryForMergeAction via PerformUnboundAction, but it always returns a 400 error.

Input:

 
 
json
{
"actionName": "msdyn_SuggestPrimaryForMergeAction",
"item/RecordList": [
{
"@odata.type": "Microsoft.Dynamics.CRM.account",
"accountid": "(accountid)"
},
{
"@odata.type": "Microsoft.Dynamics.CRM.account",
"accountid": "(accountid)"
}
]
}

Error response:

 
 
json
{
"error": {
"code": "0x80040265",
"message": "Suggest primary record plugin failed!!!"
}
}

What I've checked so far:

  • Both accounts exist and are active

  • No custom plugins registered on Merge for the Account entity (only ActivityFeeds on Case/Anfrage)

  • Plugin Trace Log shows no entry for msdyn_SuggestPrimaryForMergeAction at all, even with tracing set to "All"

  • We have Dynamics 365 Sales Enterprise licensed

Questions:

  1. Is msdyn_SuggestPrimaryForMergeAction even intended for use in Power Automate flows, or is it only used internally by the Duplicate Detection UI?

  2. Is there a correct way to call this action programmatically, or should I use the standard Merge action instead?

Any help appreciated! :)

I have the same question (0)
  • Suggested answer
    Subra Profile Picture
    1,190 on at
    Hi @LA-29040853-0

    Please find the below suggestions.

    1. I think this action can be used only for the internal purpose and it can't be as a public action.

    2. Yes, you can use the standard merge functionality.
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • André Arnaud de Calavon Profile Picture
    305,600 Super User 2026 Season 1 on at
    Hi,
     
    I'm not sure if the action can be called via Power Automate. Can you share the settings you have for this action in your flow and share the input and output values from the flow run for this action?
  • Suggested answer
    11manish Profile Picture
    825 on at
    Instead of relying on msdyn_SuggestPrimaryForMergeAction, implement your own primary-record selection logic and then use the supported merge functionality.

    For a robust Dynamics 365 duplicate-account automation solution:
    • Detect duplicate accounts
    • Determine the primary account using your own business logic
    • Use the supported Merge operation
    Avoid depending on msdyn_SuggestPrimaryForMergeAction unless Microsoft provides official guidance and support for programmatic usage.

    This will result in a more reliable and maintainable solution that is less likely to break after future Dynamics 365 updates.
  • Suggested answer
    LA-29040853-0 Profile Picture
    8 on at
     
    the input for the Action:
     
    {
        "host": {
            "connectionReferenceName""shared_commondataserviceforapps",
            "operationId""PerformUnboundAction"
        },
        "parameters": {
            "actionName""msdyn_SuggestPrimaryForMergeAction",
            "item/RecordList": [
                {
                    "@odata.type""Microsoft.Dynamics.CRM.account",
                    "accountid""ca4e74ee-df7b-ef11-a670-6045bd87478f"
                },
                {
                    "@odata.type""Microsoft.Dynamics.CRM.account",
                    "accountid""20cc155a-f44a-ed11-bba1-6045bd90590f"
                }
            ]
        }
    }
     
     
    the output of the Action:

    {
      "statusCode": 400,
      "headers": {
        "Cache-Control": "no-cache",
        "OData-Version": "4.0",
        "Content-Type": "application/json; odata.metadata=minimal",
        "x-ms-service-request-id": "ec49a737-c352-4436-a46f-2c938c4e4213"
      },
      "body": {
        "error": {
          "code": "0x80040265",
          "message": "Suggest primary record plugin failed!!!"
        }
      }
    }

    The Settings:

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Subra Profile Picture

Subra 136

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 95 Super User 2026 Season 1

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 85 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans