Sunday 13 May 2018

Getting vlaue/Id/Name of lookup field in a form using CRM custom workflow or plugin

Getting vlaue/Id/Name of lookup field in a form using CRM

Description:
In this example we explain that how to get Lookup field Text and value using Custom workflow in Dynamic CRM or Dynamic 365.or how to get or set the Lookup Text and Value in Dynamic CRM using custom workflow activity. Or getting Lookup value in custom workflow using dynamic crm. or get Lookup Id in custom workflow.

So here we demonstrate that how to retrieve the Name/value of the selected Lookup field and display it in text field using custom workflow in dynamic crm. Below is the code to get the Text and value of the Lookup field in Dynamic CRM using custom workflow.

Code:

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

 if (entity.LogicalName == "ms_case")

{

 if (entity.Attributes.Contains("abaxis_look"))

   {

   EntityReference abaxisLP= (EntityReference)entity.Attributes["abaxis_look"];

    var abaxisLookupName = abaxisLP.Name;

    var abaxisLookupId = abaxisLP.Id;

  }

}



This entry was posted in :

0 comments:

Post a Comment