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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to Retrieve look field value in crm plugin

(0) ShareShare
ReportReport
Posted on by 30

How to Retrieve Lookup field value 

Can u briefly explain with logical names also 

I have the same question (0)
  • Suggested answer
    Vipin J Profile Picture
    1,603 on at
  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Use below code to retrieve lookup field value from CRM Plugin -

    // Code to retrieve record from CRM based on Record GUID

    Entity targetEntity= _service.Retrieve("Entityname", RECORDGUID,new ColumnSet("Lookup field Logical name"));

    // You can also get TrahetEntity from plugin context using below code

    Entity targetEntityFromContext=(Entity)context.InputParameters["Target"];

    if(targetEntity.Attributes.Contains("Lookup field Logical name"))

    {

    EntityReference lookupfieldvalue=(EntityReference)targetEntity.Attributes["Lookup field Logical name"];

    Guid lookupfieldGuid=lookupfieldvalue.Id;

    string lookupfieldEntityName=lookupfield.LogicalName;

    }

    Good Luck!

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans