CRM Javascript Set Value to Null
-
Monday, April 16, 2012 1:32 PM
I want to clear a field in CRM using Javascript. I have some code that pulls address information from the associated account record and displays it on the contact record. However, if the account field is deleted it remains on the contact record because my script only updates changes. Anyway how would I set a field to null.
Can I do something like crmForm.all.new_accountaddresscity.DataValue = Null
All Replies
-
Monday, April 16, 2012 1:45 PM
Try this
Xrm.Page.data.entity.attributes.get("new_accountaddresscity").setValue(null);
Thanks Anil Chelasani http://exploringxrm.wordpress.com
- Proposed As Answer by Anil Chelasani Monday, April 16, 2012 1:48 PM
-
Monday, April 16, 2012 2:09 PM
I was actually right crmform.all.new_accountname.Datavalue = null;
Does the trick.
- Marked As Answer by pslager Monday, April 16, 2012 2:09 PM

