Set entityreference to null in MS CRM 2011 – Quick Tip


Sometime we need to set lookup field to null through server side code. We can do this using different way in late bound and early bound. If you are looking to set lookup field to null using late bound you can use below code

entity.Attributes.Add(“lookupfieldname”, null);

And if you are looking to set lookup field to null using early bound, you can simply use like below

entity.attributename=null;

Enjoy !!!


					
Advertisements

1 Comment

Filed under MS CRM 2011

One response to “Set entityreference to null in MS CRM 2011 – Quick Tip

  1. Rachida

    thanks a lot đŸ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

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