Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Lookup show "No Name" as display

Posted on by 790

hello,

I'm writing this piece of code to fill a lookup field and it is working fine except that the display name of the lookup is always "no name":

//Set Masterlineid
EntityReference lookupEntity = new EntityReference();
lookupEntity.LogicalName = "quotedetail";
lookupEntity.Id = (Guid)targetEntity.Attributes["quotedetailid"];
lookupEntity.Name = (string)product.Attributes["name"];
quotedetail.Attributes["new_masterlineid"] = lookupEntity;

I also tried this :

quotedetail.Attributes["new_masterlineid"] = new EntityReference("quotedetail",(Guid)targetEntity.Attributes["quotedetailid"]);

and got the same issue.

Any help is appreciated.

*This post is locked for comments

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Lookup show "No Name" as display

    Please check below reference-

    community.dynamics.com/.../306942

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Lookup show "No Name" as display

    Hi

    You do not have to set the Name field value for a lookup.  Dynamics CRM would handle that for you.

    It looks like your Quote Line item does not have value set for Primary field - quotedetailname

    Please make sure this field is not empty

    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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans