How to flag that a height selection or width selection is out of the range of a piece of equipment. For example, our photopolymer developer can handle sheets up to 17.5 x 24 inches. The object is to have the pricing form prevent a user from entering dimensions which can not be produced. This code is for use when there is a limit to both height and width. For additional discussion on validating User Input see how-to_validate_a_users_input
Concept
The concept is to flag the mistake at the time the product is created in the estimate or work order by using the cfl_reference logic and Error Trapping capabilities of the pricing form. The purpose is to provide some simple generic code which a user can modify to create an error check or trap of his choosing.
Cautions
It is important to test all variations of possible entries as the user will not be able to exit or save the form if there is a mistake in the formula. One user has made an excellent suggestion that all Product Error code should first be tested in the pricing_ch_03-products section to be sure it is working correctly.
Steps
Make sure the smallest side is smaller than the smallest dimension (17.5 inches) and the largest side is smaller than the large dimension (24 inches)
Declare OneSideTooBig :=
(MIN(PolymerHeight, Polymerwidth) > 17.5 inches)
OR (MAX(PolymerWidth, PolymerHeight) > 24 inches);
Declare SizeMessage := “Maximum Dimensions for Polymer are 17.5 x 24 inches.” ;
IF OneSideTooBig THEN SizeMessage ELSE “” ENDIF;
<code> 4. Test your new error trap with every possible dimension in both height and width to be sure that it is working correctly.
Source
- Contributor: Steve Gillispie , Acorn Sign Graphics
- Date: 07/08/2009
- Version: Control 4.3