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.

Case Statement with three results.

Featured Replies

I have this script that I built in FM Dev 6. This script is put on a calculation field that is a container.

Case( PatternCount( SortField, "LastName¶" ),

GetRepetition( SortPicture,

If( MiddleWords( SortDirection,

PatternCount( Left( SortField, Position( SortField, "LastName", 1, 1 ) ), "¶" ) + 1, 1 ) = "Ascending", 1, 2 ) ) )

Basically what I need is,

If SortField = LastName then

If the SortDirection = "Ascending" then put in the 2nd picture from the SortPicture container.

If the SortDirection = "Descending" then put in the 1st picture from the SortPicture container.

The default picture has to be the 3rd picture from the SortPicture container.

Not certain of your syntax overall, but I'd do it like this in pseudo-code:

If (PatternCount(SortField, "LastName¶" );

If (SortDirection = Ascending; Pic2; Pic1);

Pic3

);

I think it's simpler.

David

Case(

Sortfield = LastName and SortDirection = "Ascending"; Pic2;

Sortfield = LastName and SortDirection = "Descending"; Pic1;

Pic3)

But it should be

GetRepetition ( Pics ; Case(

Sortfield = LastName and SortDirection = "Ascending"; 2;

Sortfield = LastName and SortDirection = "Descending"; 1;

3))

With the pre fm7 syntax... Because it can't be stressed strongly enough, this is where repeating fields really come in handy and is a "legitimate" use of this field type - Since this is far from 1NF violations.

--sd

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.