<div dir="ltr">Hi Alan,<div><br></div><div>I hope you can make use field model level getValidator() api to define special validator for fields, which can be defined in particular module js files based on view.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 7:20 PM, Alan Lord <span dir="ltr"><<a href="mailto:alanslists@gmail.com" target="_blank">alanslists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 10/02/15 13:23, Jonathan Sardo wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you speaking about ajax edition?<br>
</blockquote>
<br></span>
I guess so.<br>
<br>
This is my kind of thinking right now:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
jQuery(window).load(function() { // Hold off until page fully loaded<br>
    var module = app.getModuleName();<br>
    var view = app.getViewName();<br>
    var moduleClassName = module+"_"+view+"_Js";<br>
    if(typeof window[moduleClassName] != 'undefined') {<br>
<br>
        window[moduleClassName]("<u></u>LSValidation_Intercept_Js",{<br>
<br>
            interceptInstance : false,<br>
<br>
                getInstance: function(){<br>
                        if(LSValidation_Intercept_Js.<u></u>interceptInstance == false){<br>
                                var instance = new LSValidation_Intercept_Js();<br>
                                LSValidation_Intercept_Js.<u></u>interceptInstance = instance;<br>
                        }<br>
                        return LSValidation_Intercept_Js.<u></u>interceptInstance;<br>
                },<br>
<br>
            init : function() {<br>
                this.interceptInstance = LSValidation_Intercept_Js.<u></u>getInstance();<br>
                console.log(this.<u></u>interceptInstance); // Check we're running<br>
            }<br>
        },{<br>
<br>
            saveFieldValues : function(fieldDetailList){<br>
                var thisInstance = this;<br>
                var targetFn = this._super;<br>
<br>
                console.log(fieldDetailList);<br>
<br>
                // If we pass our own validations then<br>
                // pass back to parent function<br>
<br>
                        return targetFn.call(thisInstance, fieldDetailList);<br>
            },<br>
<br>
            registerEvents : function(){<br>
                this._super();<br>
            }<br>
<br>
        });<br>
    }<br>
});<br>
</blockquote>
<br>
This should load my javascript library as an extended class of the underlying module (I will include some tests to limit the loading of it if it is not Detail or Edit view etc...)<br>
<br>
But I can't get the override of the saveFieldValues() call to trigger. The above is basically how the Accounts_Detail_Js overrides the standard Vtiger_Detail_Js saveFieldValues function.<br>
<br>
My idea being to have two override functions in here; one for Detail/Summary views and one for Edit View. If this kind of method can work then ultimately it should also be possible to deal with the Quick Create in a similar way too.<br>
<br>
Al<br>
<br>
<br>
______________________________<u></u>_________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">With<br>Best Regards<br>Uma.S<br><div>Vtiger Team</div></div></div>
</div>