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.

Featured Replies

I am in need of a temporary bandaid during a migration while we consider changing a process.

 

I want a calculation that takes a list of fields (which are containers holding icons) and puts them into a single global container calculation repetition so I can use rep1 for 'Add' and rep2 for 'Edit' etc. globally.  I've used similar with regular Admin and Preferences data but not like this.

 

Upon startup, icon_TRIGGER (a global number in the one-record Admin table) will be set with 1.  This script step can also trigger this calculation to re-evaluate.  The refresh will fill the global containers at startup for use during the User session.  It is temporary ... I know it can break if I change the order ... all I need is quick fix.  If I can make this calc work, the 'fix' will only require a single calculation and the fewer moving pieces, the easier it will be when removing it again.

 

Here is my attempt which failed (quite miserably).  I believe that containers can't be treated like text multi-lines and it has other issues as well, such as no extend (what would I extend?)

Let ( [
  trigger = Admin::icon_TRIGGER ;
  i = Get ( CalculationRepetitionNumber ) ;
  icons =
    List ( 
      Admin::icon_add ;
      Admin::icon_delete ;
      Admin::icon_edit ;
      Admin::icon_gotoDetail ;
      Admin::icon_popover ;
    ) ;
  icon = GetField ( GetValue ( icons ; i ) & "[" & i & "]"  )
] ;
Case ( i  ≤ ValueCount ( icon ) ; GetValue ( icon ; i ) ) 
)

I also realize I could reverse it - put the icons into repetitions - that would be easiest but there are many companies on versions of these files and I can't make that kind of drastic change just yet.

 

:idot: Any ideas while I still have some roundness to my forehead?  And if I HAVE to add more schema just for this functionality I suppose I will but I don't want to mirror all those fields nor create another table (yet).

 

added sentence in blue

Edited by LaRetta

Try:

Let ( [
  trigger = Admin::icon_TRIGGER ;
  i = Get ( CalculationRepetitionNumber ) ;
  iconList =
    List ( 
      GetFieldName ( Extend ( Admin::icon_add ) ) ;
      GetFieldName ( Extend ( Admin::icon_delete ) ) ;
      GetFieldName ( Extend ( Admin::icon_edit ) ) ;
      GetFieldName ( Extend ( Admin::icon_gotoDetail ) ) ;
      GetFieldName ( Extend ( Admin::icon_popover ) )
    ) 
  ] ;
  Case ( 
    i ≤ ValueCount ( iconList ) ;
    Extend ( GetField ( GetValue ( iconList ; i ) ) )
  )
)

Although:

Extend ( GetField ( ... ) )

works after a fashion, I would suggest you avoid the detour and get directly to what you want, for example:

Let (
trigger = Extend ( gTrigger )
;
Choose (
Get ( CalculationRepetitionNumber ) - 1 ;
Extend ( Icon_add ) ;
Extend ( Icon_delete ) ;
Extend ( Icon_edit )
)
)

Note the Extend() around the triggering field - I don't think it will work without it, even in your version.

 

--

P.S. This is a calculation field in the Admin table, is it not? Why does it need fully qualified field names to reference fields in the same table?

  • Author

Wow, thanks guys, I see now where I got twisted.  

 

--

P.S. This is a calculation field in the Admin table, is it not? Why does it need fully qualified field names to reference fields in the same table?

 

Ah, that was from data viewer. Your calculation has been implemented and it is perfect and I can proceed!   :laugh2:

Good. BTW, you could also do it this way =

Let (
trigger =  Extend ( gTrigger )
;
Extend ( Choose (
Get ( CalculationRepetitionNumber ) - 1 ;
Icon_add  ;
Icon_delete ;
Icon_edit
) )
)

but then repetitions #4 and higher will error out, trying to extend a non-existing field.

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.