Setting a lookup value to null

To set a lookup field to null you’d do the following in your c# code:

vehicle.new_accountid = new Lookup();
vehicle.new_accountid.IsNull = true;
vehicle.new_accountid.IsNullSpecified = true;

To do the same using JavaScript, you’d do the following:

crmForm.all.new_accountid.DataValue = null;