Answered by:
CRM Date field remove the date on Form Save

Question
-
On CRM 2011 a custom entity have Date field when i save the form it date become null
but on others entities date is working well.
what is problem??
Muhammad Sohail
- Edited by sohail450 Tuesday, September 2, 2014 9:23 AM
Tuesday, September 2, 2014 9:22 AM
Answers
-
Is the field read-only? Are you setting the value with JavaScript? If both those conditions are true you would need to add an additional line line of JavaScript to force the field to be submitted:
Xrm.Page.getAttribute("field").setSubmitMode("always");
Read-only fields are submitted back to the server by default.
Jason Lattimer
My Blog - Follow me on Twitter - LinkedIn- Proposed as answer by JLattimerMVP, Moderator Tuesday, September 2, 2014 1:26 PM
- Marked as answer by sohail450 Monday, October 13, 2014 12:53 PM
Tuesday, September 2, 2014 1:26 PMModerator
All replies
-
Hi Muhammad,
Can you add more details to you question?
Where does it become null, on the database? are you looking the values on the database?
the CRM date field is a nullable type
Does it have somewhere a custom javascript like this?:
Xrm.Page.getAttribute("new_datefield1").setValue(null);
I Hope I could help. If I have answered please mark as 'Answer'. If was just helpful, please vote. Thanks and happy coding! Bruno Lucas, http://dynamicday.wordpress.com/
Tuesday, September 2, 2014 12:20 PM -
Is the field read-only? Are you setting the value with JavaScript? If both those conditions are true you would need to add an additional line line of JavaScript to force the field to be submitted:
Xrm.Page.getAttribute("field").setSubmitMode("always");
Read-only fields are submitted back to the server by default.
Jason Lattimer
My Blog - Follow me on Twitter - LinkedIn- Proposed as answer by JLattimerMVP, Moderator Tuesday, September 2, 2014 1:26 PM
- Marked as answer by sohail450 Monday, October 13, 2014 12:53 PM
Tuesday, September 2, 2014 1:26 PMModerator -
Jason means "Read-only fields are not submitted back to the server by default. "
Hope this helps.
Adam Vero, Microsoft Certified Trainer | Microsoft Community Contributor 2011
UK CRM Guru BlogSaturday, September 6, 2014 3:27 PM