Skip 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.

Dynamically move to next field based on logic?

Featured Replies

Hi folks,

The question is: How can I code for DYNAMIC movement to some field if something is true. Example:

Say I have 5 global fields, in which I want to insert a value based on some criteria. There’s also a loop involved. The fields are G_1, G_2, G_3, G_4, G_5

Enter Browse Mode

Sort [ Restore sort order ]

Go to Record/Request/Page[ First ]

Set Field [ FamilyCount, C_Family ]

Loop

If [A= 1 ]

Set Field [ G_1, Yearof EarliestScreening ]

End If

Go to Record/Request/Page [ Next, Exit after last ]

If [ A=1 ]

Set Field [ G_2, Yearof EarliestScreening ]

Else

Set Field [ g_Difference, Abs(G_1 -Yearof EarliestScreening) ]

End If

Go to Record/Request/Page [ Next, Exit after last ]

If [ FamilyCount <> C_Family ]

Go to Field [ FamilyCount ]

Set Field [ FamilyCount, C_Family ]

Else

If [ A=1 ]

Set Field [ G_3, Yearof EarliestScreening ]

End If

Exit Loop If [ Status( CurrentModifierKeys)=1 ]

Exit Loop If [ Status( CurrentRecordNumber) = Status( CurrentFoundCount) ]

End Loop

Do you see my point? I dont want to hardcode G_1, G_2, etc. If I could specify the field name as number, I could set the counter=G_1 + 1, but this is impossible here.

Just wondering if anyone had this issue before.

Thanks

If I get what you mean, use the GetField(field) function. You can use its like GetField("G_"& X)

  • Author

falkaholic,

Thanks for your reply. GetField("G_"& X) might work if I need to get the value from the G_X field, but I need to first set it to a certain value. I need something like SetField("G_"& X), but I can't seem to imbed the GetField in the set field function.

Something like SetField(GetField("G_"& X), whatever)). Is that doable?

Much simpler way, maybe?

Why not just put G1 through G5 in a related table, each record has two values - Key value (1 - 5) and whatever the value is. Then, you would just makea dynamic field that relates to that key value, then just change the related record value once you set the dynamic link. Make sense?

  • Author

do you mean like G's is a global number with 2 repititions fields in auxilary file, and there's some X field in the main file that's incremented as in X+1 ?

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.