Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using the new validation business map
#1
In an ongoing attempt to get a hacked installation more and more in an 'original' state, I'll be updating again soon. One of the customizations I made is some custom validations that will be overridden by the dividable validations on inventory modules (which ironically, I wrote). So I'm diving into the new validation business maps, that seem promising. I'd like to get some more info on using the custom functions here.

I see in the docs that a sample validation function is provided (all the way at the bottom) that returns 'true'. I know in the past we had a special '%%%OK%%%' value to return (or something like that). Does anyone have pointers on the return values possible when using custom functions?

Also, I see in the example custom function validation map:

Quote:restrictions: file name, validation test name, function name and label to show on error (will be translated)

And then:

PHP Code:
<map>
  <
originmodule>
    <
originname>Accounts</originname>
  </
originmodule>
  <
fields>
    <
field>
      <
fieldname>email1</fieldname>
      <
validations>
        <
validation>
          <
rule>custom</rule>
          <
restrictions>
          <
restriction>modules/cbMap/Validation.php</restriction>
          <
restriction>testemail</restriction>
          <
restriction>validate_testacccemail</restriction>
          </
restrictions>
        </
validation>
      </
validations>
    </
field>
  </
fields>
</
map

I see three restrictions, the second is the 'validation test name' (testemail), but what is that? Also, the fourth optional (not used in the example) will be the label on error and that it will be translated, but from where, from the target module's language files?
Reply


Messages In This Thread
Using the new validation business map - Guido1982 - 10-30-2017, 08:17 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)