locked
retrieve customer field crm 2011 RRS feed

  • Question

  • Hi,

    How can I retrieve in plugin Customer field?

    Thursday, March 27, 2014 9:23 AM

All replies

  • I assume the Customer field you are trying to retrieve is an Entity Reference.

    So in order to retrieve it you need to cast it as one. 

    EntityReference contactlookup=(EntityReference)targetEntity.Attributes["new_contact"];

    Thursday, March 27, 2014 12:40 PM
  • Try this

    EntityReference contactlookup=(EntityReference)targetEntity.Attributes["customerid"];

    Thursday, March 27, 2014 10:58 PM
  • you can also use like below

    EntityReference customer=targetEntity.GetAttributeValue<EntityReference>("customerid");


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Friday, March 28, 2014 12:27 AM
    Moderator