[Vtigercrm-developers] extend Validation engine (Ajax)

Uma S uma.s at vtiger.com
Tue Feb 24 10:16:32 GMT 2015


Hi Alan,

*I've looked at the checkDuplicateName function in Vtiger_Helper_Js() and
am trying to work out how this is used by Account's Detail.js but I'm a bit
(very) confused. I don't really understand this jQuery.Deferred() stuff.*

Api which is making call to deferred api in jQuery, should wait until the
deferred api returns back the response from executing the following lines
after deferred call.

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.

On Tue, Feb 24, 2015 at 2:05 PM, Alan Lord <alanslists at gmail.com> wrote:

> Hi again,
>
> How can I implement an ajax-based validation routine?
>
> For example, I want to check that when someone enters or changes a phone
> number in a record, that the phone number is *unique* in vtiger.
>
> I have my validation routine calling an Ajax action and I can interrogate
> the database and return true or an error string (with where the duplicate
> record is).
>
> This is where I have got to but obviously it isn't working:
>
> http://paste.ubuntu.com/10385395/
>
> What I can't figure out is how to make the validate engine work with
> Ajax...
>
> I've looked at the checkDuplicateName function in Vtiger_Helper_Js() and
> am trying to work out how this is used by Account's Detail.js but I'm a bit
> (very) confused. I don't really understand this jQuery.Deferred() stuff.
>
> Anyone have a cluebat handy?
>
> Cheers
>
> 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/20150224/fa96cde3/attachment.html>


More information about the vtigercrm-developers mailing list