Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Problem LINQ

$
0
0

Hi all,

I'm having a problem in a Plugin and it's related to a LINQ query that I'm trying to do, the code throwing the error is the next:

//'List' object is an Array of records of a Custom Entity, in this case it has 675 Record Objects and only 1 is Active

//In the line below I'm trying to retrieve all Account Id's from the records contained in 'List'. I was debugging the code and all objects has pwc_AccountId.Id as a property

  var test = List.Select(bp => bp.pwc_AccountId.Id).ToList();

The error that I'm getting is:

Object reference not set to an instance of an object

I don't really understand why I'm getting this error, as long as I can see there's no Null or empty object in that line code.

Do you guys know what could be the problem here?

Thanks in advance!


Viewing all articles
Browse latest Browse all 55831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>