Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with business map - validation
#2
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 Smile )

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 Smile
Reply


Messages In This Thread
RE: Help with business map - validation - elisa.deko - 03-14-2019, 04:49 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)