AnsweredAssumed Answered

Sugar 7 - CreateView not working

Question asked by Ramon Marcondes on Jun 22, 2016
Latest reply on Jun 24, 2016 by Ramon Marcondes

Hello.

I'm using Sugar Enterprise 7.5 for production system, and 7.7 for test system.

I need to change a datetime module field value in the page as soon as the page is loaded. It's for a custom module.

The first solution was to use "calculated fields", but there is a bug in the production system where the calculated field option is not working (in the test system it works).

I already contacted the Sugar Enterprise Case Portal support, but for now there is no definitive solution, so I need some client-side workaround for this...

Only for information, this is the case I opened:

https://web.sugarcrm.com/support/cases/ed616e88-3c09-b55e-0f3d-5762edd4f032

 

The worse, I've tried several tutorials about customizing the module form in CreateView, but none of them worked.

It isn't even printing something on the browser console. I've already succeed on printing on console with a RecordView code (for form validation).

For now, I only need the CreateView validation working, I will do the remaining field logic later.

 

There is the code, in the create-actions.js file (not working):

({  
    extendsFrom: 'CreateView',  
    initialize: function(options) {                       
        this._super('initialize', [options]);                                    
        this.on('render', this.testFunc, this);  
    },  
    testFunc: function() {    
        console.log("Test");  
        _.each(this.fields, function(field) {  
            if (_.isEqual(field.def.name, 'data_init')) {  
                console.log("entered");   
            }  
        }, this); 
    },  
})  

 

Any help would be appreciated.

Thanks!

Outcomes