Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checking field validation when exiting layout - what if multiple related recs?

Featured Replies

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 by Guest

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

  • 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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.