Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

Posted on by 420

Howdi folks!

I have the following requirement: Ability to indicate on a contact record whether that contact is set as a Primary contact on an Account record.   The contact may or may not have that Account set as it's parent Account.

There are also a number of other lookups on the Account to the contact entity and I would like to indicate on the contact record whether that contact record is set in any of those lookups.  The reason for this is that these are key notification contacts and I need to make it obvious to users that this is the case so they take extra care with them.  Ideally I'd set some flags so I can utilise synchronous workflows to prevent them being deactivated when they are one of these contacts. 

Is anyone aware of a way of achieving this by being creative with native functionality? I don't think it's possible but I feel like there may be something I'm missing.

The query is all there for the taking in Advanced Find

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true">
  <entity name="contact">
    <attribute name="fullname" />
    <attribute name="telephone1" />
    <attribute name="contactid" />
    <link-entity name="account" from="primarycontactid" to="contactid" alias="ab"></link-entity>
  </entity>
</fetch>


 If not I'll just have to admit defeat and solve with a plugin.  

Thanks in advance.

Alex

*This post is locked for comments

  • AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Thanks for the heads up Steven, I'd better keen an eye on it then. 

  • WrqnHrdr Profile Picture
    WrqnHrdr on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Alex,

    One issue I have noted with rollup fields.  When value should set from 1 to zero it sometimes fails leaving a false positive.  I have had to write custom sql jobs to recalculate to zero this last year.

  • Suggested answer
    AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Just as an update to this, in case it helps anyone in the future - I've just looked again and managed to come up with a nice solution using native CRM functionality:

    Step 1: Create new Rollup fields on the Contact form which count the number of related accounts for any relationship between contacts and accounts.  One for each.  For example "Number of accounts where this contact is set as a Primary Contact"

    rollupfields.PNGrollupfields.PNG

    Step 2: (Optional) Hide the rollup fields and create some Business Rules on the Contact form which flip some Boolean flags when one or more of these rollup fields is greater than 0

    Step 3: Create a synchronous workflow which triggers before change of status, performs a check to check the record isn't already inactive then checks whether any of these fields are greater than 0, if they are it cancels workflows with a custom message to the user "Cannot delete contact - this contact is a key contact"

    preventdeactivate.PNG

    This seems to do the job nicely and without the need for any custom development! Happy days! 

  • Suggested answer
    AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Hi Guido,

    Thanks for confirming I am not missing anything with the customisation options and will require custom code to achieve my requirements.

  • AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Hi Prashant,

    The problem with your approach as far as I'm aware is that it works for setting the flag to "Yes".  However, when they are disassociated with that Account record (when a different Primary contact is selected on the account then) the native workflows are unable to set the flag back to "No" as the relationship has been removed. If I'm missing something on this then please let me know. Cheers.

  • AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Hi Raz,

    Thanks, this is a nice suggestion and use of the Quick forms. I've had to rule it out as it is still reliant on the Account being set in the Contact's Parent Account lookup, which may not be the case.  Also it only provides a visual indication, not an explicit one. Many thanks for taking the time to reply though.

  • AlexJay Profile Picture
    AlexJay 420 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    HI Vishnu, I'm not sure that you've understood my question. Thanks for your response in any case.

  • Suggested answer
    PS Profile Picture
    PS 23,577 on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Hi Alex,

    Follow the steps below:

    Step 1: Create a two option field on contact form, say, 'Primary  Contact' Yes/No (Default Value=No)

    Step 2: Create a workflow on accounts, trigger on change of field 'Primary contact'

    Condition: if <Account(Primary Contact)> contains data

    Update: Primary Contact (update 'Primary Contact' field to Yes)

  • Suggested answer
    razdynamics Profile Picture
    razdynamics 17,304 User Group Leader on at
    RE: Need a nice solution for indicating whether a contact is a primary contact of an account on the contact record.

    Hi Alex, you could achieve this without code by creating a Quick View form on the Account Entity which includes the Parent Contact Field, and then on the Contact Form you can click on the Insert Tab and add the Quick View Form you created on Accounts to the Contact Card, tis allows you to define the lookup and entity relationship and quick view form for the account. This way you will be able to see the Primary Contact on the Contact  records that share the same parent account.

    Hope that helps :)

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans