Parameter: orderFormRestrictions
Where:
The parameter orderFormrestrictions can be found at:
- Backoffice -> Settings -> Parameters -> Order Entry, table: orderFormrestrictions
Note:
The more rules you apply, specially rules concerning goodslinefields, causes the page to take more time to load. A faster way is to code the rules in the ordertemplate itself.
How to use:
- The param is based on spaces (quoted strings can contain spaces) and newlines of the following format:
field restriction [if clause,..] [ || 'Message to user' ]
- Where field is the field name of the oe-form and restriction can be 'mandatory'.
- The if-clause is of the format: field operator value [relation]
- Where the optional relation can be 'and' or 'or' and the operator = or <> (unequality).
- The value must be quoted by single quotes.
- Goodsfields can be written as a macro: @weight
, @quantity
etc. to have them expand to weight1, quantity1, weight2, quantity2 etc. (currently set to 5 times repetition).
- Use @@ to have the numeric replacement exactly at this position.
- Other restrictions are: 'typeof', 'readonly', or 'notallowed' where typeof can specify 'number' or 'positive':
- field restriction
With 'notallowed' it is possible to have a '<' or '>' as the first character of the value indicating smaller then and larger then. You can have a _ as secondary character followed by a number to validate the length of the value.
It is also possible to check for occurences of a character by starting the value wich is not allowed by a #.
One character is special: use #amp for #&. Fieldnames can contain a wildcard (*).
- It is also possible to have default values when user entered a value for a field:
field set value = '12345' if clause [execute = JavaScript function call without space, ...]
where the if clause can be just one if clause or nothing.
A line can also be a relation between two lines when a line is exactly 'and' or 'or'.
Note:
- This parameter will only be working in new orderentryform templates
- On request, programmers are able to add this functionality to your template(s).
If requested, use your Bugtracking system.
Examples:
# which fields are mandatory when creating an order.
orderRef mandatory
#orderReference can have values up to 4 positions
orderReference not allowed '>_4'
* notallowed '>_35'
#check for pipes
* notallowed '#|'
#check for ampersand
* notallowed '#amp'
#check for minus sign
* notallowed '#-'
# Time before 18:30 needs two rules
deliveryTime notallowed '>18:30'
deliveryTime2 notallowed '>18:30'
# conditional not allowed value, in this case customerID 90023 may not use deliveryType 'Af fabriek'
deliveryType notallowed 'Af fabriek' customerID='90023'
deliveryTel mandatory deliveryCountry<>'NL (Nederland)' and deliveryCountry<>'BE (België)'
deliveryTerms mandatory consignmentType='Parcels'
pickupContact mandatory consignmentType='Parcels' or consignmentType='documents'
or
pickupContact mandatory deliveryCountry<>'NL (Nederland)' and deliveryCountry<>'BE (België)'
# field quantity always mandatory in first goodsline, please note the absense of @
quantity1 mandatory
# number
@weight typeof 'number'
# number and positive
@height typeof 'positive'
@quantity not allowed '<5'
@weight mandatory @quantity<>''
@length mandatory @quantity<>''
@width mandatory @quantity<>''
@height mandatory @quantity<>''
#mark the absence of spaces in the execute part:
@length set value = '12345' @palletID='euro' execute = roundDecimal(this,0)
@loadmeters readonly
# restrict postcode to postcode format or empty string
deliveryPostcode regexp '[0-9]{4}[A-Z]{2}$'
--
PieterHoekstra - 2013-02-19