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 !!!


							

2 thoughts on “Set entityreference to null in MS CRM 2011 – Quick Tip

Leave a Reply

Your email address will not be published. Required fields are marked *