[Vtigercrm-developers] extend Validation engine

Uma S uma.s at vtiger.com
Wed Feb 11 09:25:56 GMT 2015


Sure Alan! you can handle this define the custom validation that need to be
performed in module specific js file which should extend standard validator
(Vtiger_PhoneValidator_Js). So that during validation you can call parent
class validate() api to perform standard validation on field.

For example : Please check Vtiger_Percentage_Validator_Js in
FieldValidator.js (modules/Vtiger/resources/Validator) which is making use
of Positive number validator.

Hope, I made the point clear.

On Wed, Feb 11, 2015 at 2:04 PM, Alan Lord <alanslists at gmail.com> wrote:

> On 11/02/15 08:22, Uma S wrote:
>
>> Hi Alan,
>>
>> /If I want to have multiple "layers" of validation so that for example I
>> must do a custom check to make sure some other module record contains
>> the right value and then use one of the standard validators *as well* on
>> the same field, how would I do this?/
>> /
>> /
>> Sorry! I am not clear on this above point. Do you mean you are looking
>> for how to use existing validator's on your custom field?
>>
>
> No, not a custom field. It might not even be a custom module.
>
> We frequently need to apply customer-specifc validation routines.
>
> For example, suppose I am editing an Account record (example the phone
> number field) and before I am allowed to save this field I must check that
> something is valid in a related module (which might be custom or might be a
> normal one, like an Invoice for example...).
>
> If my custom validation rule works, then that phone field will still need
> to run the standard validation in Vtiger_PhoneValidator_Js.
>
> Does this make sense?
>
> Alan
>
>
>
>
>
>
> _______________________________________________
> 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/20150211/a193371e/attachment.html>


More information about the vtigercrm-developers mailing list