locked
Saving Date field with a NULL value using JavaScript RRS feed

  • Question

  • I'm trying to set null value to the Opportunity estimated close date based on the Sales stage. When Opportunities are loaded into CRM, estimated close date has some date value. But as the user progresses through different sales stages, I need to display null value and disable this field. Currently I am able to display null value on the form and disable the field but when the Opportunity is saved back to the system, the null value is not being stored to database, as a result the date value from the database is being displayed on the view.

    How can I fix this? Here is the code I have in OnLoad of the Opportunity form.

    crmForm.all.estimatedclosedate.DataValue = null;
    crmForm.all.estimatedclosedate.Disabled = true;

     

    Tuesday, December 7, 2010 9:10 PM

Answers

  • Hi Shil,

    Try adding the force submit line

    crmForm.all.estimatedclosedate.DataValue = null;
    crmForm.all.estimatedclosedate.Disabled = true;
    crmForm.all.estimatedclosedate.ForceSubmit = true;


    Eric UNG [Senior Analyst Programmer :: Sydney, Australia]
    • Proposed as answer by HIMBAPModerator Tuesday, December 7, 2010 9:55 PM
    • Marked as answer by shiil Tuesday, December 7, 2010 9:56 PM
    Tuesday, December 7, 2010 9:47 PM