September 15, 201213 yr I have a portal in which all fields are required. My script so far: If [isEmpty (table::StaffID)] Show Custom Dialog ["Validation Failure!! StaffID must have a value"] Go to Field [table::StaffID] Halt Script End If I have two problems to solve. 1) I want to invoke this script them someone tries to exit the portal row--all I can come up with is to apply a trigger to the last field, and have it implement on save or exit. What if the enduser skips the last field? (which they aren't suppose to do). Is there another way to do this. 2) There are a total of 4 fields in the portal and all four should be required. How do I modify the script to ensure that all four fields will require data?
September 15, 201213 yr 1) You can use onObjectExit by right clicking the portal in Layout mode and selecting "Set Script Triggers" and that would trigger the script if the user tried to leave the portal or go to another row in the portal. Or you could set the trigger on each field exit (but then you'd have to have separate validation scripts for each field). 2) If you use onObjectExit for the portal, nest your validation script. ie: If [isEmpty (table::StaffID)] Show Custom Dialog ["Validation Failure!! StaffID must have a value"] Go to Field [table::StaffID] Halt Script Else If [isEmpty (table::StaffFirstName)] Show Custom Dialog ["Validation Failure!! StaffFirstName must have a value"] Go to Field [table::StaffFirstName] Halt Script Else If [isEmpty (table::StaffLastName)] Show Custom Dialog ["Validation Failure!! StaffLastName must have a value"] Go to Field [table::StaffLastName] Halt Script Else If [isEmpty (table::StaffsWifesPhoneNumber)] Show Custom Dialog ["Validation Failure!! StaffsWifesPhoneNumber must have a value"] Go to Field [table::StaffsWifesPhoneNumber] Halt Script End If
September 15, 201213 yr Author That works beautifully! Thank you so much for your quick and easy solution. I very much appreciate!!!
Create an account or sign in to comment