Skip to main content

Notifications

Dynamics 365 general forum

lookup field and primary field

Posted on by Microsoft Employee

field-problem.PNG

Hi, I have spent more than 1 day in solving this problem:

In my entity Project Contact, the custom field Contact is a Lookup field (to the out-of-box entity Contact). I know that the primary field of an entity can't be set as Lookup, so I didn't use keep this primary field.

In my second entity Project Activity entity, there is a field "Responsible person", which should Lookup to the Project Contact entity.

But the "Responsible person" field automatically looks up to the primary field of the Project Contact entity, and this primary field is empty!

When I click on the search box, I can see and choose the records for "Responsible person". But it shows "No Name" in the end.

I would like to set the value of "Responsible person" to this primary field. I tried workflow, which is only one-time thing. Now I think I need to write a JavaScript code, which I am not clear about.

Could anyone help me? Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: lookup field and primary field

    Hi Wei Jie Fun,

    You are right. My problem was that I selected "As an on-demand process", which made the process asynchronous.

    Thanks a lot

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: lookup field and primary field

    Hi Christine,

    i think in your previous workflow, actually it is working, but because background workflow need some time to run, it will not run immediately, thats why you dont see any values on the primary field. You can take a look on below post .

    community.dynamics.com/.../222018

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: lookup field and primary field

    Thank you for all the replies. The problem is solved with a real-time workflow, and the Project Activity's primary field set with Contact's full time.

    In my previous workflow, the primary field was set with the Contact field in the Project Activity entity, and it won't work.

    Anyone knows the reason? Thanks again.

  • Suggested answer
    Emre GULCAN Profile Picture
    Emre GULCAN 2,379 on at
    RE: lookup field and primary field

    Hi,

    Depend on your answer, you should use workflows to set your "new_name" field

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: lookup field and primary field

    Thanks for reply. I actually have several other custom fields on Project Contact entity.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: lookup field and primary field

    Thanks. I think the key is real time, instead of on-request.

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: lookup field and primary field

    Hi,

    Create a real time workflow, trigger on update and create, then set the responsible person to that primary field. Dont have to go for JS.

  • Verified answer
    Emre GULCAN Profile Picture
    Emre GULCAN 2,379 on at
    RE: lookup field and primary field

    Hi,

    If I understand correctly, your "Project contact" entity's primary field (probably "new_name") is empty and this is the reason of why you see "no name". You should set "Project contact" entity's primary field with Contact's fullname by javascript / business rules or workflow.

    Actually I wonder that if you don't have any additional custom fields on Project Contact entity you don't need to use this, directly create lookup field with Contact entity on "project activity" entity

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans