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.

Continue calculation only if a field contains value

Featured Replies

I've not had any luck trying to figure this one out - my calculation skills are minimal!

I have a Calculation (thanks Ted S /Genx) for a field called 'KN Prefix' which works just fine:

Let (

[

dotCount = PatternCount ( VFX::KN Input Temp; "-" );

dotPos = Position ( VFX::KN Input Temp; "-"; 1 ; dotCount )

];

Left ( VFX::KN Input Temp; dotPos - 1 )

)

However if a field called 'Slate' in the same table is empty, I want this calculation to either stop or if a value has already been entered in 'KN Prefix' I need it to be cleared.

In simple (non FM) terms its needs to do this before the calc:

if Slate is empty

then clear KN Prefix

and stop

otherwise continue

Apologies for the crude description,

Thanks, Mark

One field cannot clear another field, unless the process is automated with scripts and/or event plugins, which are generally not necessary.

You explanation isn't really clear.

I'd have a field called "KN Prefix Entry" which is a text field, and a field called "Slate" whch is also a text field.

Create a calc field called "K Prefix" which would be:

If( IsEmpty( Slate ) ; "" ; KN Prefix Entry )

If Slate is empty then display nothing, otherwise display the contents of KN Prefix Entry.

  • Author

Thanks Vaughan. That seems to work well. One last question though:

Is it possible to have a Lookup request as part of that if statement? So instead of saying use 'KN Prefix Entry' if 'Slate' is not empty, it would be something like, do Lookup if 'Slate' is not empty?

Thanks, Mark

Why do you want to use a Lookup?

Lookups are *only* useful if there is a need to bring in a related value at the time of record creation and keep it static for historical purposes (like a price, or a tax rate).

If you want to bring in a *related* value, then just specify it in the calculation.

A looked-up value would be done by adding another text/number field as a lookup, then including this in the calc. The field would have the value in it even if it isn't needed.

  • Author

Good point! I am still finding my feet in this area and hadn't fully understood when to use Lookup and when to use Calculation. You're absolutely right though, a calc is much more suitable. This is all working great now, thanks for your time and help.

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.