web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Primary Contact ID on the case form

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi Patrick ,

    proceed as follows:

    1) Open Case form editor

    2) Double click on Primary Contact attribute

    3) Change Related Records Filtering

    0564.Cattura.PNG

    Please let me know if you solve.

    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

  • Patrick Friedrich Profile Picture
    395 on at

    Hi Francesco, thanks for the quick reply.

    On primarycontactid I selected nothing. But if I open the lookup I can nly choose related contacts to the company.

    4214.Unbenannt.png

  • Community Member Profile Picture
    on at

    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

  • Patrick Friedrich Profile Picture
    395 on at

    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

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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
    395 on at

    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 - MVP Profile Picture
    30,190 Moderator on at

    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
    395 on at

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

  • Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    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
    395 on at

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans