08-10-2020, 03:07 PM
OK, so following that I could get it to work, but it doesn't quite do what I want. First of all, it didn't work when I setup the map like this (shortened for brevity)
because apparently the rule and restrictions can't be empty. But do they have to contain just something, or specific stuff?
Secondly, the way I like it better is like in the blogpost, where it's not a businessmap that fires the validation but a business action in the form of a presave event hook. That way, I can immediately collect and send the account address and the result (does the account address match the address on the salesorder). Now I would have to fire a custom AJAX call to get the account information, compare that to the onscreen stuff and then do the rest. Is it correct to assume that we can use custom functions to validate through either a business map or a presave business action?
Code:
<validations>
<validation>
<rule></rule>
<restrictions>
<restriction></restriction>
</restrictions>
<message>%%%FUNCTION%%%checkAccountAddress%%%PARAMS%%%{field},lbl</message>
</validation>
</validations>
Secondly, the way I like it better is like in the blogpost, where it's not a businessmap that fires the validation but a business action in the form of a presave event hook. That way, I can immediately collect and send the account address and the result (does the account address match the address on the salesorder). Now I would have to fire a custom AJAX call to get the account information, compare that to the onscreen stuff and then do the rest. Is it correct to assume that we can use custom functions to validate through either a business map or a presave business action?