---+++ How to create an ErrorPage with in your WorkPlaceForms This page is a walk-through to generate an ErrorPage in your forms so the form user would access before finalizing the form (either submit or sign). Ativan in pregnancy can cause congenital defects in the future child. Do not use lorazepam without the consent of the doctor if you are pregnant. Inform your doctor if you became pregnant during reception ativan drug. Use effective remedies of the control over birth rate when accept this drug. Till now influence lorazepam on chest feeding is not studied. Soothing effects lorazepam can be shown more at old people. Avoid hit in open wounds of a preparation lorazepam. Do not give ativan drug to the child, is younger than 12 years. There are a few steps before we start. It also worth mentioning that this is not the only method to generate or warn the error to users but to the best of my knowledge it was the most creative way to warn and direct the FormUser to the errors he/she made while filling the form. To start we need to know a few background on the form error types and how to approach the problem: * the common source of errors are: * Leaving a mandatory field blank (UnfilledFields) * Filling a field with incorrect format * Signiture Buttons which are set to be mandatory The key function to start error checking with is called _checkValidFormats()_. calling this function inside a properly made compute (say when checkerrors button is pressed) will generate asearchable array of errors in runtime. The programer can refer/search and deal with the errors by looking into this array. The following code, if placed inside a button, will find all the errors within your form and generate the related array: If you try the code you will realize that button's value also set to the first error found in the form. This is because *global.global.custom:errorsFound* array elements holds all the errors found in the form. inorder to access these errors you should refer to array elements starting from 0 upto the number of errors found in the form minus one. Another useful function is _countChildren()_. We can use this function to count the number of errors found in the form. combining this function with forloops (_for()_) and _strstr()_ functions can help us find exactly where the errors was found. ---+++++Spotting errors in a single page There are occasions that we are only interested in the errors found in a particular page. Unfortunately as to this date, there is no option available within functions of WorkPlaceForms (WPF 2.6.1) to target only errors in one page. However, there is an efficient way to target these errors. The following code explains it better: Assume the form consist of few pages. we are interested in the errors in myPAGE and we want the next button (for simplicity we refer to it as myBUTTON) only activated when there is no error in the page. In given code we set an action (called myAction) to first find about any possible error in the whole form. Then we set a for loop up to the last element in the *errorsFound_array* array and with in the for loop we search the sid of the elements using _strstr()_ function. If the sid of the desired page (myPAGE) was found we dissable myBUTTON. The code is written inside an action and action triggeres every time the focuse of the fields changed inside form. When the action is triggered the number of errors found inside the myPAGE page will be updated. inorder to trigger the action this line of code shgould also be included in the global part of the myPAGE page: for an alternative approach please refer to [[https://www-128.ibm.com/developerworks/forums/dw_thread.jsp?message=13773082&cat=41&thread=101768&treeDisplayType=threadmode1&forum=782#13773082][this page]]. ---+++++Creating a list of errors A more fancy approach to excite the form user is to enable him to see all the errors he/she made within the form and ask him/her to go back and correct them. The way to do this for the whole form is a little tricky and we should use a more complex code with in the ErrorPage we create. To make this happen we basically need to creat a few items on the page. on following I have addeded a ToDO list of elements which should apper in your error page as well as on all pages which an error might exist. When all these are completed the form enable the user to see the errors he made, he click on it and the form automatically will take the user to the corresponding field. The items to be added in the error page: * a list with a group name so we can add cells to it later. Make the list long enough so it could show at list 10 errors at the time. Here is sample code: 100 100 500 150 ERROR_LIST_GROUP 2 * a number of cells with the same group name. Here is one cell but if you are willing to show 10 errors at the time you should repeat this for the 9 more cells (but with different arbitrary values: ERROR_LIST_GROUP . . . * an action for setting the items inside the error list. The code is given bellow: 2 9 9 2 4 a b c d * Customize the array of possible errors inside myAction. The name of array is important and also each entry should have an arbitrary value. There should be one array entry per any possible error. Therefore, the number of entries in the array should be equal to the total form errors if nothing is filled in the form. An example for a form with possible 4 errors came below: a b c d _(bug report: if you enter "2" as the value of the second array entry the code will crash. Could be a bug in the API behind it)_ * Another action to take you where the error has happened. The code is given below: off a b c * Also to any page that we set a field to be mandatory or we set a format for the field we should add the folloing code to the global part of the page: * Last but not least, we add the following code to any field which is mandatory or have a defined format: The field 'Field Name' on 'Field Page' is After you apply the given changes to your form you should have an ErrorPage set up in your form. For more information I have also attached a testform with an ErrorPage which is created by applying the above changes to the form. Finally, I should thank and credit this work to the following names which helped me in coding and/or ideas needed to make an This is YourOwnSandBox topic. %INCLUDE{NewSanboxTopic}%