[Vtigercrm-developers] extend Validation engine (Ajax)

Alan Lord alanslists at gmail.com
Wed Feb 25 08:14:42 GMT 2015


On 24/02/15 10:16, Uma S wrote:
>
> For example : In Accounts Detail.js saveFieldValues() api is making call
> to isAccountNameDuplicate() api which is an deferred api. So the line
> following the call to isAccountNameDuplicate() api will not execute
> until response is returned from the called  api.
>
> Hope, my explanation might add some value.

I'm getting there - slowly...

If you look at this code http://paste.ubuntu.com/10404014/ now you'll 
notice I have the .done() and .fail() Deferred functions in my 
validate() function and these are being triggered correctly.

However, what I have discovered (using the console.log() calls is that 
the static function "invokeValidation" in *my* jQuery class is not being 
called at all so I can't return the promise back up the chain. It must 
be using the invokeValidation from the Base Validator. So, without 
hacking, how can I delay the return to that as it is not coded to wait 
for a promise?

Perhaps I am missing something about how the static parts of these 
jQuery classes are overridden?

Thanks

Al




More information about the vtigercrm-developers mailing list