Conditional and Context-Driven Relationships
BeginnerBuild relationships that change which records they match based on context -- the current user, a date, a mode flag -- using global fields and calculation match fields.
What you'll learn
- How global fields create relationships that vary by session or user
- How calculation match fields enable dynamic predicate logic
- Use cases: user-specific filtering, date-ranged relationships, mode-driven contexts
- How to refresh relationship results after changing match fields
Most relationships use static field-to-field predicates. But some use cases require the relationship to match different records based on who is looking, what mode the system is in, or what the user selected. Global fields and calculation-based match fields enable this dynamic behavior. Used carefully, they are powerful; overused, they make the solution hard to debug.
Global field as dynamic match value
A global field holds one value regardless of which record is current. Use it on the left side of a relationship predicate to create a relationship whose right-side records change when the global changes.
// Use case: show records assigned to the current user // Global field: Globals::gCurrentUserID (set at login by a script) // Relationship: Globals::gCurrentUserID = Tasks::AssignedToUserID // At login: Set Field [ Globals::gCurrentUserID ; Get ( AccountName ) ] // The Tasks_CurrentUser portal shows only tasks for the logged-in user. // When a different user logs in, gCurrentUserID changes, and the portal shows their tasks.
Sign in to track your progress and pick up where you left off.
Sign in to FM Dojo