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

Change Primary Person on a Company

(0) ShareShare
ReportReport
Posted on by 177

We have a "Primary Contact" lookup (pointing to Contacts) on our Company records. There is also a "Primary Contact?" yes/no field on the Contact record so when a user is viewing a list of contacts, they can see who the primary contact is without having to navigate to the company form. The business requirement is that any company must always have a primary contact assigned. We are forcing the user to update the primary contact through the lookup on the company form. When that value changes, we must update the previous primary contact record's "Primary Contact?" yes/no field with "no" and then update the new primary contact "Primary Contact?" yes/no field with "Yes." What is the best way to do this? I seem to be able to set the new primary contact with "yes" without issue. However, setting the previous primary contact with "No" seems to be the problem--I'm not quite sure how to do this. Any help is appreciated.

*This post is locked for comments

I have the same question (0)
  • saturation Profile Picture
    177 on at

    Is anyone able to help?

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at

    You need custom Plugin development, whenever a new Primary Contact lookup value is updated:

    1. the plugin registered on Post update of Account will trigger

    2. you just have to retrieve the previous Primary Contact by filtering the AccountId & Flag in Contact entity

    3. then update it as "No"

    4. updating the flag of New Primary contact as "Yes"

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 April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans