August 1, 200124 yr In a very complex Invoice validation situation, I need to avoid all field-level validation. Therefore, I am collecting and validating all the data by script. One of many validation parameters is: The part number entered in the temporary gPart# field must be a number contained in a field in the Parts database. In field-level validation this would be easy. But in a script, how can I say something like: If(Part# is not a member of Parts::Part#), ShowMessage [This is not a valid number] End If I can't find anything in the manual that I could do, short of scripting a full-on Find request and error message collection.
August 2, 200124 yr If you are collecting data into global fields and validating those prior to writing the data to a record, I assume that you are doing so on the request of a user to add an item to the invoice? If so do not let the user proceede until ALL validation errors are cleared up. As soon as you find an error, simply alert the user and return them to the editing screen so that they can correct the error.
August 2, 200124 yr Author Yes, this is the case. I have the user fill out all the temp fields, then hit an "add" button which triggers the validation script. For the part number field, I want that script to validate part numbers by scanning the parts inventory database and triggering an error message if not found. What is the best way to do this?
August 2, 200124 yr Setup a relationship ValidPart = gPartNumber::PartNumber. Then a simple calc to validate IsValid ( ValidPart::PartNumber ) and you are done.
Create an account or sign in to comment