---++ Parameter: orderFormRestrictions %TOC{depth="6"}% ---+++ 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:<em><br />field restriction [if clause,..] [ || 'Message to user' ]</em> * Where field is the field name of the oe-form and restriction can be 'mandatory'. * The if-clause is of the format:<em> field operator value [relation]</em> * 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': * <em>field restriction</em><br />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. <br />It is also possible to check for occurences of a character by starting the value wich is not allowed by a #. <br />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: <em><br />field set value = '12345' if clause [execute = JavaScript function call without space, ...]</em><br />where the if clause can be just one if clause or nothing. <br />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).<br />If requested, use your Bugtracking system. * options notallowed and readonly cannot be combined with an if clause ---++++ Examples: <pre># which fields are mandatory when creating an order. orderRef mandatory </pre> <pre>#orderReference can have values up to 4 positions</pre> <pre>orderReference not allowed '>_4'</pre> <pre>* notallowed '>_35'</pre> <pre>#check for pipes</pre> <pre>* notallowed '#|'</pre> <pre>#check for ampersand</pre> <pre>* notallowed '#amp'<br /><br />#check for minus sign</pre> <pre>* notallowed '#-'<br /><br /># Time before 18:30 needs two rules</pre> <pre>deliveryTime notallowed '>18:30'</pre> <pre>deliveryTime2 notallowed '>18:30'<br /><br /># conditional not allowed value, in this case customerID 90023 may not use deliveryType 'Af fabriek'<br /><br />deliveryType notallowed 'Af fabriek' customerID='90023'</pre> <pre>deliveryTel mandatory deliveryCountry<>'NL (Nederland)' and deliveryCountry<>'BE (België)'</pre> <pre>deliveryTerms mandatory consignmentType='Parcels'</pre> <pre>pickupContact mandatory consignmentType='Parcels' or consignmentType='documents' or pickupContact mandatory deliveryCountry<>'NL (Nederland)' and deliveryCountry<>'BE (België)'</pre> <pre># field quantity always mandatory in first goodsline, please note the absense of @ quantity1 mandatory</pre> <pre># number </pre> <pre>@weight typeof 'number'</pre> <pre># number and positive</pre> <pre>@height typeof 'positive' </pre> <pre>@quantity notallowed '<5'</pre> <pre>@weight mandatory @quantity<>''</pre> <pre>@length mandatory @quantity<>'' @width mandatory @quantity<>'' @height mandatory @quantity<>''</pre> <pre>#mark the absence of spaces in the execute part: </pre> <pre>@length set value = '12345' @palletID='euro' execute = roundDecimal(this,0)</pre> <pre>@loadmeters readonly<br /># readonly switch cannot be combined with condition<br /><br /># restrict postcode to postcode format or empty string </pre> <pre>deliveryPostcode regexp '[0-9]{4}[A-Z]{2}$'<br /><br /># restrict postcode format per country<br /># pickup- and delivery fields must be tested seperately<br /># it is not possible to make combinations, i.e. "Belgium, Austria, Luxemburg and Hungary all have 4 digits"<br /># this many rules have a definite effect on the speed of the order entry form!!!</pre> <pre>pickupPostcode regex '^[0-9]{4}[A-Z]{2}$' pickupCountry='Nederland' pickupPostcode regex '^[0-9]{4}$' pickupCountry='Belgie' pickupPostcode regex '^[0-9]{5}$' pickupCountry='Duitsland' pickupPostcode regex '^[0-9]{5}$' pickupCountry='DE' pickupPostcode regex '^[Gg][Ii][Rr] 0[Aa]{2}|(([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2}$$' pickupCountry='Engeland' pickupPostcode regex '^[0-9]{2}\-[0-9]{3}$' pickupCountry='Polen' pickupPostcode regex '^[0-9]{4}\-[0-9]{3}$' pickupCountry='Portugal' deliveryPostcode regex '^[0-9]{4}[A-Z]{2}$' deliveryCountry='Nederland' deliveryPostcode regex '^[0-9]{4}$' deliveryCountry='Belgie' deliveryPostcode regex '^[0-9]{5}$' deliveryCountry='Duitsland' deliveryPostcode regex '^[0-9]{5}$' deliveryCountry='DE' deliveryPostcode regex '^[Gg][Ii][Rr] 0[Aa]{2}|(([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) [0-9][A-Za-z]{2}$$' deliveryCountry='Engeland' deliveryPostcode regex '^[0-9]{2}\-[0-9]{3}$' deliveryCountry='Polen' deliveryPostcode regex '^[0-9]{4}\-[0-9]{3}$' deliveryCountry='Portugal'</pre>
This topic: Cargooffice
>
AboutFreecargo
>
FreightExchangeHowto
>
WebHome
>
ParametersDocumentation
>
ParametersOrderentry
>
OrderFormRestrictions
Topic revision: r36 - 2021-04-15 - WiljoVanLenthe
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback