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.

Trouble with a simple (?) calculation

Featured Replies

I'm trying to give a field a certain status if a field in a related table is not empty.

I've tried this calculation but nothing happens.

If ( not IsEmpty(Order::Objekt_nummer); Status; "Start")

I've also (unsuccessfully) tried putting the calculation in the related table.

What am I doing wrong here?

It's not clear, is it if the related tables holds any records, or that the present have related records.

For the first would you need an extra cartesian relationship, the second would a IsValid( be pretty fast to establist a record and in particular if you let it examine if a foreignKey exists.

--sd

  • Author

When there's a record created in the related table, that record has a field that gets a serial number - it is that field that I want my calculation to check out, and if there is a number, set the Status field in the present table to "Start".

How do I "examine if a foreignKey exists" within this calculation?!

regards

Anders

A calculation field calculates a result - it does not set another field. You should probably make your Status field itself a calculation =

If ( IsEmpty ( Order::Objekt_nummer ) ; "Start" ;

  • Author

OK, that worked!

But maybe what I'm trying to do is totally wrong.

I want the end user to be able to manually change the Status field when necessary - and a calculated field will not allow you to do that, right?!

Maybe a script that can Set a field is better?! In that case, how do I trigger a script that will set the Status field to "Start"?!

(I'm sorry if I come across as confused, but at the moment that's probably because I am!)

I am confused as well. It would be easier if you explained what is the purpose here. A calculation referencing a related field must be unstored, so no - it cannot be overwritten by the user.

However, you could set up an unstored calculation field, and another field for user override, so the calculation would be something like:

Case (

not IsEmpty ( Overridefield ) ; Overridefield ;

IsEmpty ( Order::Objekt_nummer ) ; "Start" ;

)

  • Author

I apologize if I've been unclear.

The purpose with the Status field is to show the user if there's been an order made (that's in the related table) on a project.

When a project's declared finished, they want to change the status to "post production" or "finished".

regards

Anders

I think I would still make Status a calculation field. Let them "declare the project finished" by filling a DateFinished field. Then just add this condition - and any other conditions that affect the status of the project - to the Case() function.

  • Author

I've added a second condition to my Case calculation, but it's just the first one that will work. Even if it's just the second condition that is valid, nothing happens .

Case ( not IsEmpty ( Order::Objekt_nummer ) ; "Start" ; Case ( not IsEmpty ( Offert:;)_Offert_ID ) ; "N/A"; ""))

Same thing if I reverse the order of the two conditions - I thought that Case will override any condition that has another (valid) one in front of it, so to speak...

Update: it _does_ work!

The calculation I was working on wasn't displayed in any layout! The Status field I was looking at was an older calculation that just contained one condition. :

Thank you Søren and comment for all the input!

regards

Anders

Edited by Guest

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.