<div dir="ltr">Hi Alan,<div><br></div><div><span style="font-size:13px"><i>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.</i></span><br></div><div><span style="font-size:13px"><i><br></i></span></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Hope, my explanation might add some value.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 24, 2015 at 2:05 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">Hi again,<br>
<br>
How can I implement an ajax-based validation routine?<br>
<br>
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.<br>
<br>
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).<br>
<br>
This is where I have got to but obviously it isn't working:<br>
<br>
<a href="http://paste.ubuntu.com/10385395/" target="_blank">http://paste.ubuntu.com/<u></u>10385395/</a><br>
<br>
What I can't figure out is how to make the validate engine work with Ajax...<br>
<br>
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.<br>
<br>
Anyone have a cluebat handy?<br>
<br>
Cheers<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>