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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Updating An Entity From Plugin Trips Workflow

(0) ShareShare
ReportReport
Posted on by
I have a plugin that is sending some Opportunity data to another system of ours when certain fields in the opportunity are updated and then I save the id of this new record from this other system back into the opportunity.  We have a workflow that runs when the status changes, it checks a few fields to verify they meet our requirements and if not, prevent the opp from going to the next sales stage.  Sometimes, not always, this workflow is tripped when I do an update on the opp even though the only thing I've changed is adding this id to this opportunity.  The sales stage never changes.  These required fields are missing but since the sales stage never changes and technically, we don't require these fields until the user tries to move it to the next sales stage, this should pass this workflow.  I've registered this plugin the /Post Operation/ pipeline stage because I want to make sure the opportunity is saved before this plug in runs.  Is there something I can do so that my plugin bypasses this validation?  Is there a better way I should be handling this scenario?  Is there something I need to check with our required field validation when sales stage changes?   I don't want to block the user form saving the opportunity, just want to be able to process some of the data after it's saved.  Below is an example of my code.
 
 IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
_service = factory.CreateOrganizationService(context.UserId);
 
if (context.InputParameters != null)
{
      Entity entity = (Entity)context.InputParameters[/Target/];
      Entity opp = (Entity)_service.Retrieve(/opportunity/, entity.Id, new ColumnSet(true));
 
    <Save some of the opp data to this other system and get back the id>
 
    opp.Attributes[/my_system_id/] = item.id;
   _service.Update(opp);
}
 
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 128 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 113

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans