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)

How to Link two newly created records

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

I have the same question (0)
  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    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.

  • Garethp Profile Picture
    50 on at

    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.

  • Davina Sungum Profile Picture
    146 on at

    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

  • Davina Sungum Profile Picture
    146 on at

    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

  • RaviKashyap Profile Picture
    55,410 Moderator on at

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

    Thanks, I have started a new thread for this.

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

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