Technical Fun

Deactivating Entity Member on CRM 3.0

Posted on: November 19, 2007

I wanted to deactivate an entity member and was confused.
Here’s to get you out from the same headache.
Replace ENTITYNAMEHANDLER with your entity’s name.

(note that oCrm is an instance of the Crm Web Service)

SetStateENTITYNAMEHANDLERRequest state = new SetStateENTITYNAMEHANDLERRequest();
state.ENTITYNAMEHANDLERState = ENTITYNAMEHANDLERState.Inactive;
state.ENTITYNAMEHANDLERStatus = 2;
state.EntityId = new Guid(GUID_OF_THE_TARGET_MEMBER);
SetStateENTITYNAMEHANDLERResponse stateSet = (SetStateENTITYNAMEHANDLERResponse)oCrm.Execute(state);

With that, you’re done :), are you? eh? really? huh? …

Advertisements
Tags: ,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: