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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Primary Field Lookup

(0) ShareShare
ReportReport
Posted on by

I have created a new entity which represents a Team Member for a company.  The Team Member is a user (employee) and there can be many members of the team.  Also, the Team Membership entity has other data that defines the membership parameters.

My problem is this:  when creating the entity, the Primary Field is limited to a Single-Line-of Text field type.  I don't need a name field as there is a field in the entity that is a lookup into our User entity to add an employee.  I just need to make that lookup the primary field and display the name of the selected employee.

Can someone point me in the right direction to accomplish this?  As you can probably tell, I'm a newbie to CRM.  I am a developer, but I'm trying to do as much in the UI as possible.

Thanks,

Glen W.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    GL-23071537-0 Profile Picture
    Microsoft Employee on at

    Hi Glen,

    What I often do is remove that field from the form and make it not required.  Then I create a workflow that concatenates information from the record into the Name field.  This might be something like "Employee - Team" or something like that.  

    This Name field can also be populated with plugins or JavaScript, or even an add-on like PowerAutoNumber, and the reason you might consider other methods besides workflow is determine by the volume and the methods that are being used for creating the Team Member record.  But for the most part workflow is a good solution.

  • Verified answer
    jlattimer Profile Picture
    24,564 on at

    The system does force a primary field (single line of text). However what you can do is either do into the field properties and make it no longer required and then remove it from any forms and views.

    If you haven't already, you need to create a 1:N relationship from your new entity to User - once you do you should have the option to place a lookup for a User record on your new entity form.

    Then you can ignore the Name field - or populate it with JavaScript/Plugin/Workflow if you want to use it.

  • Glen W. Profile Picture
    on at

    Jason,

    Thanks for the info.  I had tried deleting it before and got the message that it it was required by the system so I didn't go and try to just make the field not required.  That works with one exception:  even though I have made it not required (No Constraint) it still won't let me remove it from the form.  So, I just made it invisible.

    Thanks again,

    Glen

  • Glen W. Profile Picture
    on at

    Gretchen,

    Thanks for the info.

    Glen

  • Robert.Martin Profile Picture
    15 on at

    I do something very similar and do not like it one bit.  The problem gets worse if you need to use lookup fields as the Primary Field is (de-facto) required at that point.  If Microsoft really wanted to fix this right, the Primary Field would be eliminated altogether.  Instead a hidden GUID would be the anchor and a lookup field would require a unique name and any other field in the entity could be selected as the display field.  There would be some restrictions of course, like you could not select one lookup field to be the display for another.  Honestly, this problem creates hacky (sorry, I'm guilty too) workarounds that introduce unnecessary dependencies, complexities, and maintenance.

  • Suggested answer
    Community Member Profile Picture
    on at

    You can work around this with a workflow. The primary field is a required element of an entity you cannot do without. The trick is to hide this primary field. Maintain the custom lookup field and use a workflow to populate the primary field with the value of the lookup field.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans