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.

Calculation field don't perform on new created record

Featured Replies

Hi

I have this fonction in a calculation field : "If ( Get ( TotalRecordCount )-Get ( RecordNumber ) >0 ;  "perform record: present - (record +1)")"

what I need is if the current record is not the last then..... take the present value - next record value 

 

I also tried like this but I get "?" on every new record created. If I modify the calculation script then it run the calculation and everything work but for only old records, it s like the calculation run only one time on the creation. 

If ( Get ( TotalRecordCount )-Get ( RecordNumber ) >0 ; GetNthRecord ( FIELD ; Get ( RecordNumber )+1 )-GetNthRecord ( FIELD ; Get ( RecordNumber ) ))

 

maybe I miss something, I don't get why it's not working ?

 

thank you :) 

I don't really understand what you're describing. Or why you would need such thing. I would just note that a calculation referencing the next record needs to be unstored. And even if it is unstored, it will not automatically refresh its displayed value when the next record is created/modified. That will happen only if you click into the field, or refresh the window.

Note also that:

4 hours ago, ibobo said:

If ( Get ( TotalRecordCount )-Get ( RecordNumber ) >0 ; GetNthRecord ( FIELD ; Get ( RecordNumber )+1 )-GetNthRecord ( FIELD ; Get ( RecordNumber ) ))

can be simplified to =

If ( 
Get (RecordNumber) = Get (TotalRecordCount) ; FIELD ;
GetNthRecord ( FIELD ; Get (RecordNumber) + 1 ) - FIELD
)

 

Edited by comment

Wouldn't such an unstored calc also have different results based on how the table is sorted? And have different results in a found set?

Just now, OlgerDiekstra said:

Wouldn't such an unstored calc also have different results based on how the table is sorted? And have different results in a found set?

Why yes, of course. Any calculation using Get(RecorNumber) is entirely dependent on the current found set (or related set, if used in portal) and sort order. That goes without saying (at least I didn't think it needed to be said).

And since you point this out, it would probably be best to replace Get (TotalRecordCount) with Get (FoundCount).

  • Author

Hi Comment,  thank you :)

maybe a should run a script to calculate that field , I ll do as you update it.

I always come with strange calculation ))))

 

14 minutes ago, ibobo said:

maybe a should run a script to calculate that field 

As I said, i don't know what the purpose here is, so I cannot say.

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.