November 13, 200619 yr Hi All. I have a script that checks for all of the field validations when the user tries to exit the record/layout (I have two buttons that allow navigation away from the layout). If any of the validations fail, the user gets a specific error message and the script exits. This works perfectly, except for one issue. I have several portals on the layout and i do not believe that the validation checks against every related record, only the first one. Is it possible to script a check against every related record? Thanks for any input. Edited November 13, 200619 yr by Guest
November 14, 200619 yr HI deego I have a similiar checking process and indeed I have a portal. Some of my validation is across from the main file to the related records (ie you have said this record is black but some of your related records say it is white etc.) Here is a section of my script that demonstrates on 2 occasions where I have gone from the main file where this script runs to a related file (the one that the portal uses, that is called 'order sections') If [ Descfile::G_Highest Number = "Not Numbered." or IsEmpty( Descfile::G_Highest Number ) or GetAsNumber( Descfile::G_Highest Number ) < 1 ] [color:blue]Go to Related Record [ From table: “Order sections_dno” External; Using layout: ] [ Show only related records ] Perform Script [ “Check for yes numbered” from file: “Order sections”] Select Window [ Current Window ] If [ Order sections_dno::G_Numbering check > 0 ] Show Custom Dialog [ Title: "Checking the description details"; Message: "You have NOT entered a HIGHEST NUMBER but you have indicated that 1 or more of your sections is numbered. Please check your entries"; Buttons: “OK” ] Halt Script End If End If If [ GetAsNumber( Descfile::G_Highest Number ) > 0 ] [color:blue]Go to Related Record [ From table: “Order sections_dno” External; Using layout: ] [ Show only related records ] Perform Script [ “Check for no numbered ” from file: “Order sections”] Select Window [ Current Window ] If [ Order sections_dno::G_Numbering check = 1 ] Show Custom Dialog [ Title: "Checking the description details"; Message: "You have entered a HIGHEST NUMBER but you have indicated that 1 or more of your sections is not numbered. ¶OK to continue??"; Buttons: “YES” “NO” ] If [ Get(LastMessageChoice) = 2 ] Halt Script End If The go to related records show only related effectively creates a found set of the records in that portal on which you can do your cross checking via the external script. I then store the result of the external check in a global so that the main script knows what to do next HTH Phil
November 14, 200619 yr Author Hi Inky- Thanks a lot for your response. I had a feeling i would have to do some time of script that involved a global. I was hoping there was amore intuitive solution. Ill see if i can figure it out. This seems like this would be a fairly common issue, suprised its not more built into the app.
Create an account or sign in to comment