How to set null for field before saving form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ellen
    Senior Member
    • Jan 2018
    • 149

    #1

    How to set null for field before saving form

    Hi,
    When I change status to win how to set some field like expected start date & some more field to null.Since these filed is not enum.See picture to clear
    Purpose: I want to require my sales should update again these fileds when status change to win.
    Please help to check and advise.
    Thanks,
    Ellen
    Attached Files
  • eymen-elkum
    Active Community Member
    • Nov 2014
    • 495

    #2
    I think you need custom view for the enum field (status), it can be as following:
    HTML Code:
     Espo.define('custom:order/fields/status-field-name', 'views/fields/enum', function (Dep) {     return Dep.extend({          afterRender: function () {             Dep.prototype.afterRender.call(this);              this.model.on('<dateFieldName>:change', function () {                 this.model.unset('<dateFieldName>');             }.bind(this))         }              }); });
    Last edited by eymen-elkum; 06-24-2019, 09:18 AM.
    Eblasoft | EspoCRM specialists since 2014
    Consulting · Development · Integrations · Premium Extensions
    .

    Comment

    • Ellen
      Senior Member
      • Jan 2018
      • 149

      #3
      Hi Eymen Elkum,
      Could you please guide more detail since I'm new coder.
      Thanks
      Ellen.

      Comment

    • serqet
      Senior Member
      • Feb 2019
      • 115

      #4
      When the database of your company is rather huge, it takes your employees a lot of time and efforts to do the calculations to manipulate the field values. Fortunately, the solution to this time-consuming issue already exists.

      Comment

      Working...