[Vtigercrm-developers] extend Validation engine (Ajax)

Uma S uma.s at vtiger.com
Wed Feb 25 09:33:47 GMT 2015


Hi Alan,

*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?*

To return the promise back to invokeValidation you should make validate
api() also has deferred.

With regard to invokeVaidation() api, how you are calling this api? Usually
static api's need to called using class_name as you know :) like this
Vtiger_GlobalPhoneCheck_Validator_Js.invokeValidation()

Are you making a call to this api?

Regarding overwriting static api's i need to check, not sure.

Hope, you are following the same approach for calling static api's.

On Wed, Feb 25, 2015 at 1:44 PM, Alan Lord <alanslists at gmail.com> wrote:

> 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
>
>
> _______________________________________________
> http://www.vtiger.com/
>



-- 
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150225/88f82b0e/attachment.html>


More information about the vtigercrm-developers mailing list