[Vtigercrm-developers] extend Validation engine (Ajax)

Alan Lord alanslists at gmail.com
Tue Feb 24 08:35:23 GMT 2015


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




More information about the vtigercrm-developers mailing list