Search code examples
dynamics-crmworkflowmicrosoft-dynamicspower-automate

Possible to update a field in Sales Quota Distribution records associated with an Opportunity when Opportunity Owner is changed?


One Opportunity record can have many Sales Quota Distribution records associated to it. I want to be able to update the Opportunity's Owner field, and pass whatever is in the Owner field to EACH Sales Quota Distribution record associated to it. I have created a text field in the Sales Quota Distribution entity called "Opportunity Owner" that I want the Owner of the Opportunity record to get passed to. Is this possible? If so, how?

If not, would it help if I changed my "Opportunity Owner" field in the Sales Quota Distribution entity to a lookup field?


Solution

  • You can't update child entity records' fields in OOB Dynamics CRM workflow. As an alternative, you may create a custom workflow activity (using CRM SDK C# Code) that you can run on the update of Opportunity Owner. And what that code will do is:

    • Get all related Sales Quota Distribution entity records
    • Update "Opportunity Owner" field on each Sales Quota Distribution record
    • Update entity records in CRM

    To check how to create custom workflow activity please see the documentation on to the below link: https://learn.microsoft.com/en-us/powerapps/developer/common-data-service/workflow/workflow-extensions