web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: Change Primary Person on a Company

    Is anyone able to help?

  • 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"

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans