Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Set field value based on related entity

(0) ShareShare
ReportReport
Posted on by

Helloo,

I have a setup where an opportunity has a N:N relationship with a customer entity (in this case opportunity loss reason)

The idea being there may be multiple reasons why an opportunity was lost.

However i want to be able to validate that there is at least one loss reason set before the opportunity closes, i have tried to do this with processess and business rules but cannot find a link to put them together,

Another thought was to have a field update on the opportunity when one is set, but i cant find any way to link the opportunity to see if there is any related opportunity loss records associated.

Any help appreciated but would prefer a built in tool resolution where possible.

*This post is locked for comments

  • Verified answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: Set field value based on related entity

    Hi,

     to do it with the system N:N, you'll have to create a plugin for the "associate/disassociate" message.. or you'll have to create a custom workflow activity which would verify if there is a relationship, and, then, you can use that activity in a workflow which will trigger on "status change".

     Or you can convert that N:N to a manual "N:N" (by introducing a custom entity which has lookups to both opportunity and opportunity loss reason). Then you can attach workflows to that entity (for example, to update a "flag" field on the opportunity). But you'll also have to track delete operations..

     In the end, I'd probably use a custom workflow activity.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,432 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans