Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Primary Contact ID on the case form

Posted on by 395

Dear all,

having trouble with the field mentioned above.

If I open a ticket, I set an account in the customerid field.

Next, I want to add a contact to the primarycontactid field.

But if the contact isnt related as the primary contact to the account I cannot set him or her. It doesnt even work with a custom field in the frontend and to fill the standard field with a business rule or workflow...

Any ideas how to delete the restrictions to the primary contact field?

Thanks in advance

Patrick

*This post is locked for comments

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Primary Contact ID on the case form

    When I add the field to the BPF the same error appears. I can just hide the field, but not remove from the form due to MS restrictions. Maybe a plugin / custom workflow activity works for that?

    Update: Neither JS nor Plugin / Business Worklfow Activity works here.

    Workaround could be a connection role / custom entity for contacts.

    But I really like the N:N Relationship to display all relations between Contact A and different companies. So isnt there any proper solution?

    I think that a parentcustomerid for each contact should be mandatory - also because of data migration from other systems. But with the parentcustomerid / primarycontactid there are some limitations to work with...

    Any ideas or solutions for that scenario would be much appreciated!

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Primary Contact ID on the case form

    It seems like there is probably some backend process that is preventing this.

    I will try and look a little bit, but not sure I can workaround MS logic...

    What happens if you set the contact field in the BPF and try to get to the next stage?

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Primary Contact ID on the case form

    The Script works great, even if I have no clue about JS.

    But if I want to switch to the next BPF stage I get an error.

    And the form is marked, that there are changes made to be save. Dont know why...

    "The specified contact doesn't belong to the account selected as the customer. Specify a contact that belongs to the selected account, and then try again"

    That´s the same error I got when using a WF or BR.

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Primary Contact ID on the case form

    Do you have experience with JavaScript?

    You can add the following to the onChange event of the custom Contact and see if that works:

    function myContact_OnChange()

    {

      var contact = Xrm.Page.getAttribute("my_contactid").getValue();

      Xrm.Page.getAttribute("primarycontactid").setValue(contact);

    }

    You will need to add some additional logic to check for null values, but check if this works...

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Primary Contact ID on the case form

    That´s what I already tested. With the business rule I get an error, that the contact doesnt match with the company.

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Primary Contact ID on the case form

    What you can do is add an OnChange event to the custom Contact field. You get the value from the custom Contact and set the value to the system Contact field.

    You can do this either with JavaScript or by creating a Business Rule.

    With a Business Rule, you simply do a Set Value based on another field.

    Hope this helps.

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Primary Contact ID on the case form

    This is exactly what I thought - thanks for the confirmation. I´m fine by creating a new custom contact field but want to go on working with the standard field in the background.

    So is there a way to change the related contact field when creating a new email? Because without the standard field filled, the email will always be sent to the account instead of the contact.

    One solution could be to lock the customer field and add a business rule to fill that field with the related company?

    Background: One Contact can be responsible for different companies in different roles. So there is no fix primary company possible to fill in. I believe that´s not the first customer who is looking for such a requirement, hopefully :)

    Thanks

    Patrick

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Primary Contact ID on the case form

    Hi Patrick,

    The way it looks is that there is no way to remove that restriction on the form. This is an OOB design.

    The properties of the Contact control on the form does not have the filtering option select, so this is a backend design.

    Saying that there are two options.

    The first is to create an additional field for the entity called contact, and use that field instead of the system field. I have not tried this, but I believe this will work.

    Your second option, is to select the contact before you select the account. This will show you all the contacts.

    The third is that the business process flow on the form has an account and contact fields which are not bound to that restriction, so you can select the contact from there.

    Hope this helps.

  • Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: Primary Contact ID on the case form

    But change the filter to what?

    There is no filter option which makes sense for me. And CRM is filtering my default regarding the primary contact field. When I add a new custom lookup field to the contact entity with the same settings, than I can choose all contacts in the system. But in this case, when I write a new email the "To" wont be filled automatically with the contact.

    That´s why I want to stick to the standard.

    Thanks

    Patrick

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Primary Contact ID on the case form

    Hi Patrick ,

    Click the first checkbox and change your filter.

    Please let me know.

    Francesco

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans