(03-14-2019, 04:49 PM)elisa.deko Wrote: Hello,
regarding to your question, I would suggest you to create a Custom Validation.
I'm writing here an example for you (pls put the right field names before testing )
PHP Code:
<?php
function checkCreditCard($fieldname, $fieldvalue, $params, $entity)
{
$current_record = $entity['recordid'];
$type = $entity['typeofpayment'];
$pno = $entity['paymentsno'];
$pattern = '^(?:0[1-9]|10)$';
if ($type == "Credit Card" && preg_match($pattern, $pno) && !empty($pno))
{
return true;
}
else
{
return false;
}
}
?>
Then in your Validations Map you should add the following validation:
...
<field>
<fieldname>paymentsno</fieldname>
<validations>
<validation>
<rule>custom</rule>
<restrictions>
<restriction>include/validation/checkCreditCard.php</restriction>
</restrictions>
</validation>
</validations>
</field>
...
I hope this helps
I try do that but this variable returned blank
$current_record = $entity['recordid'];
Ranieri
eCRM Web
eCRM Web