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 :
Microsoft Dynamics CRM (Archived)

Plugin through error "An error has occurred. The selected action was not completed for one or more records."

(0) ShareShare
ReportReport
Posted on by

In bulk edit on Contact i wrote a plugin, when ever i tried to do the bulk edit it through error like this "An error has occurred. The selected action was not completed for one or more records". If i edited single record means then it not throwing me error.

Plugin steps registered on : Update

Can anyone please help me to over come this issue.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Prasanth -

    you can have a plugin for update operation.

    AFAIK, there is no plugin for 'bulk edit'.

    Now, what is the edit you are trying to do? Are you trying to edit inactive records as well?

  • Community Member Profile Picture
    on at

    I am trying to edit one specific field in the contact entity, yes they will edit both active and inactive records.Also i noted in audit history bulk edit operation event occurring as Update only.

  • Suggested answer
    Shidin Haridas Profile Picture
    3,499 on at

    Try doing the operation ONLY for active records.

    Inactive records CANNOT be updated.

  • Community Member Profile Picture
    on at

    yes currently i  am trying with active records only. I tried this below code this simple code also troughs error. but while i tired the single update the same code works fine plugin triggered. 

    public class UpdateEnrollmentPlugin : PluginBase
    {

    protected override void OnExecute(IServiceProvider serviceProvider)
    
           {
    
               var context = GetContext(serviceProvider);
    
               var service = GetOrganizationService(serviceProvider);
    
               Entity entity = (Entity)context.InputParameters["Target"] as Entity;
    
               if (context.MessageName == "Update")
    
               {
                  throw new exception(); //exception not hitting 
                 //Logic here
    
               }
    
           }

    }
     

  • Suggested answer
    Community Member Profile Picture
    on at

    We can write a plugin code for Bulk update/Edit, it works for me. I did mistake in the execution order, one or more plugin get clash on execution order means we will get this type of error "An error has occurred. The selected action was not completed for one or more records.".

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    Please check that all records in that view are active before clicking on bulk edit.

  • Martin Donnelly Profile Picture
    1,030 on at

    Threw

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans