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.

Unstored calcs and relationships ?

Featured Replies

Hi all,

Assuming we have an unstored calculation in a related file, based upon a global in the Main file.

Assuming we want to display these matches in a portal in the Main File.

I've seen a lot of question about this, and ran myself in this kind of experiences.

The best I could get at the moment, thanks to this Forum, is to :

1. use another unstored calculation of type

c_ReturnId = Case(field = ::Main:global, Record_Id, "")

2. place it in a empty layout with only that field

3. perform a Copy All Records

4. paste the result in a global field in the Main file

5. Use a new relationship Main:Global::Related:Record_Id

I was wondering if someone had tried another method. Here's the idea.

1. Use a constant relationship

2. Create another unstored boolean calc of type :

c_ReturnId = Case(field = ::Main:global, 1, 0)

3. Use that calc as the sort key of the Constant Calculation.

Now, all those matching records would come first and we can determine that records > Sum(Constant::c_ReturnId) should be omitted from the list or find c_UnstoredStatusCurrentRecordNumber<Sum(Constant::c_ReturnId)

But HOW can we script a Omit all record starting from X without having to enter the record in the dialog box???

Does anyone have another method ? I like the Copy all records, but I'm quite sure there's another solution.

Thanks.

Instead of Copy all, you can Loop, and Set field (global, global & "

Copy all records is really much faster then looping. But in deed not really 'neat'...

  • Author

Hi,

Yes, Copy All is really much faster....

not "Neat" is why I would like to switch to another method.

Another I've tried is to store each StatusRecordNumber in another loop script, then perform a GTRR based on a Range relationship.

Too bad we cannot store a global and perform a script Omit Starting by "this global field".

Now, the Copy All or the Loop+SetField also allow to "dynamically "show values in a portal.

Ugo DI LUCA said:

Too bad we cannot store a global and perform a script Omit Starting by "this global field".

Why not put a Goto Record [YourGlobal] scriptstep before the 'Omit' step?

  • Author

Well,

What I meant was...

As we can determine through the sorted relationship and the Sum(Related::sortkey) which is the last "record" matching the "global criteria", we could easily store it as g_RecordNumber, and have another

g_store = Sum(Constant::Record_ID)-Sum(Related::sortkey).

and then use a script :

Go to record (g_RecordNumber)

Omit Multiple (g_store - no dialog) *** That's the missing point here, as the dialog doesn't offer (in FM5.5) a way to store a global.

This would offer, at least in my case a really dynamic way to Go To Related Unstored Records....

If I understand correctly, then you want to omit all records after g_RecordNumber.

Why not just do Omit Multiple [1000000000]?

  • Author

I tried it frown.gif

Really, I think this feature is missing.

Curiously, when you set it 1,000000 records, with a dialog, you've got an alert. With no dialog, it starts counting back to the first and omit them also, from the tests I've made.

Hope I didn't conclude too fast my tests. If not, you may have solve a BIG problem and opened a wide breach in the FMI world. cool.gif

Hey Ugo,

Without dialog the 'omit multiple' scriptstep does not complain if there are not 'enough' records to omit.

Does that make you a happier man? Good!

Have a fine day,

Ernst.

  • Author

Uuhh??

I'll have to check this back when I come back. I don't have FM here...

Thanks in advance

Ugo DI LUCA said:

I don't have FM here...

Poor Ugo... smile.gif

But I checked it and it works.

Are you on holiday?

If so have a nice time. The weather should not be a problem...

Best regards,

Ernst.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

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.