Skip to main content

Notifications

Announcements

No record found.

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

  • Suggested answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at
    RE: Change Primary Person on a Company

    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"

  • saturation Profile Picture
    177 on at
    RE: Change Primary Person on a Company

    Is anyone able to help?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans