Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to Link two newly created records

Posted on by 50

Hi All, 

Thanks in advance for any help you can provide. 

Dynamics 365 Version 1612 - 8.2.2.339

Portals (updated to latest available version) 

I have a webform that creates both a Case record in CRM then a Contact record through the portal.  What I would like to do is for the Case to be linked to that contact record. 

The webform is simple and has step 1 Insert Case

Step 2 insert Contact

I assumed I linked them in the Entity Reference section of Step 2. So filled in the following:

Set Entity Reference On Save = Yes

Entity Logical Name = Case

Relationship Name = Case_customer_contacts

Populate Lookup = Yes

Entity Reference Source

Previous Step

Reference Entity step = Step 1

However, when I run through the webform, the Case and Contact are created, but the lookup on the case form is not updated. 

Have I set this up incorrectly?

Thanks for your time.

Gareth 

*This post is locked for comments

  • Davina Sungum Profile Picture
    Davina Sungum 146 on at
    RE: How to Link two newly created records

    Thanks, I have started a new thread for this.

    Please see: https://community.dynamics.com/crm/f/117/t/301668

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to Link two newly created records

    Hi Davina,

    Do you already have the record created or you are creating a record on create of case? Can you share what you have done so far?

    Also, it is advisable to open a new thread for your questions as then others can also suggest possible solutions/ workarounds.

  • Davina Sungum Profile Picture
    Davina Sungum 146 on at
    RE: How to Link two newly created records

    Ah, Actually I have tested again and it does work but it doesn't populate the field when the form loads but as it says it does on Save! :)

    Is it possible to populate more than one lookup field from previous steps with this option?

    Thanks

  • Davina Sungum Profile Picture
    Davina Sungum 146 on at
    RE: How to Link two newly created records

    Hi Ravi,

    Thanks for the information on this, I am quite new to portals and your answers have been very helpful!

    I am only able to get the above steps working when I create my record fist, then use the Set Entity Reference on Save step on Edit. It does not work when the step is Insert. Do you know why this is? I think Gareth had the same issue.

    Step 1: create record

    Step 2: Insert 2nd record type with lookup empty

    Step 3: Set entity reference type on save and use the entity reference source from step 1 to populate lookup

    This works but I need it to work on the Insert step

    Thanks,
    Davina

  • Garethp Profile Picture
    Garethp 50 on at
    RE: How to Link two newly created records

    Thanks Ravi,

    I was actually creating the Case first, then creating the contact and trying to link the two on the contact create stage.

    I moved the Entity Reference information to a CASE edit step later in the form - which may have helped. I'd tried this before and it hadn't worked, but I think I was missing the 'Target Lookup Attribute Logical Name' details because, as you said, you need to refresh the form before this is editable - so previously I'd assumed it wasn't required.

    Thanks for your help.

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: How to Link two newly created records

    Hi Gareth,

    I think cause you are associating the customer field on the case, you need to first create the contact and then create the case. In the create case step, you need to set the entity form reference and then select the values as-

    Set Entity Reference On Save = Yes

    Entity Logical Name = Contact

    Relationship Name = incident_customer_contacts

    Target Lookup Attribute Logical Name  = customerid

    Populate Lookup = Yes

    Entity Reference Source Previous Step

    Reference Entity step = Step 1

    ** You may need to refresh the form to make the 'Target Lookup Attribute Logical Name ' editable.

    Hope this 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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans