public Entity RetrieveLookupByName(string name) { ThrowIf.Argument.IsNullOrEmpty(name, "name"); var targetEntity = this.LookupTargetEntityName; if (string.IsNullOrEmpty(targetEntity)) { throw new InvalidPluginExecutionException("Field mapping error, lookup target entity is empty."); } var targets = OrgService.RetrieveMultipleByName(targetEntity, name); return(targets.FirstOrDefault()); }