views:

166

answers:

1

Hi,

I'm working on a project started by someone else, and trying to fix a few bugs. There is a custom entity that contains a list of entities to process. However it a custom entity is removed and the list is not updated there is an error thrown.

I would like to add a check that ensures that each entity that is processed is checked to ensure that it exists first.

Is this possible in CRM, If so what is the best way. Note this has been written in C# 2008.

[edit] Note: I only have the entity name to use. [end edit] Thanks

+3  A: 

Use the CRM Metadata Service (sample Metadata code from MSDN for CRM 4). You can retrieve a list of all entities (RetrieveAllEntitiesRequest) and then check each time through the loop whether or not the entity is in that list.

Matt