How add validation field in listview Calls? Sugarcrm 7.6

How add validation field in listview Calls?

I need block save action if status HELD.

In recordView, i'm use addValidationTask, but this not work in listView.

Parents
  • I'm use this soluction

    1. ({ 
    2.   //This file goes in ../custom/modules/Calls/clients/base/fields/editablelistbutton/editablelistbutton.js 
    3.   //Extend the Class. 
    4.   extendsFrom:'EditablelistbuttonField'
    5.  
    6.   _validationComplete: function(isValid) { 
    7.   //Check to see if the status is Converted.  If it is, set isValid to false to block the save and pop an error. 
    8.   if (this.model.get('status') == "Held") { 
    9.      isValid = false 
    10.      app.alert.show('validate_status', { 
    11.           level: 'error'
    12.           messages: 'your custom message
    13.           autoClose: false
    14.      }) 
    15.   } 
    16.   //This code runs all code in the original function.  This way, if Sugar changes their code, it will be picked up. 
    17.   this._super('_validationComplete',[isValid]); 
    18.   }, 
    19. }),
Reply
  • I'm use this soluction

    1. ({ 
    2.   //This file goes in ../custom/modules/Calls/clients/base/fields/editablelistbutton/editablelistbutton.js 
    3.   //Extend the Class. 
    4.   extendsFrom:'EditablelistbuttonField'
    5.  
    6.   _validationComplete: function(isValid) { 
    7.   //Check to see if the status is Converted.  If it is, set isValid to false to block the save and pop an error. 
    8.   if (this.model.get('status') == "Held") { 
    9.      isValid = false 
    10.      app.alert.show('validate_status', { 
    11.           level: 'error'
    12.           messages: 'your custom message
    13.           autoClose: false
    14.      }) 
    15.   } 
    16.   //This code runs all code in the original function.  This way, if Sugar changes their code, it will be picked up. 
    17.   this._super('_validationComplete',[isValid]); 
    18.   }, 
    19. }),
Children
No Data