OK. So how about the XML:
The above won't work since there's nothing in the <rule> or <restriction>. What needs to be in there? Just anything or specific stuff like 'contains' or 'mex'?
Sorry, but both versions aren't working for me. First of all: what I did in a recent installation:
Validation map on SalesOrders
Then the business action
Which points to JS code
Resulting in
No logging to the console and an empty alert. I checked the buffer through the network tab, it loads the JS properly.
The second method, using a PRESAVE business action, I still don't understand. Take these steps:
Code:
<validations>
<validation>
<rule></rule>
<restrictions>
<restriction></restriction>
</restrictions>
<message>%%%FUNCTION%%%checkAccountAddress%%%PARAMS%%%{field},lbl</message>
</validation>
</validations>
Sorry, but both versions aren't working for me. First of all: what I did in a recent installation:
Validation map on SalesOrders
Then the business action
Which points to JS code
PHP Code:
function checkAccountAddress(edit_type, formName, action, callback, params) {
console.log(edit_type, formName, action, callback, params);
alert('test');
}
No logging to the console and an empty alert. I checked the buffer through the network tab, it loads the JS properly.
The second method, using a PRESAVE business action, I still don't understand. Take these steps:
- I go to business actions
- I create a new one
- I select type PRESAVE
- I set some 'block://className:filePath' as the URL
- I save the business action