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.

Need simple way to display previous records

Featured Replies

On an Event Entry screen, users type in the description of new events, much like keeping a journal. The resulting entries are kept in a single table, which can grow to several hundred entries. To help avoid duplicate entries inadvertantly being made for the same event (by different users), I need to show the "description" field from the previous two or three entries at the top of the layout for their reference. Since I create a new record only when entered information is fully validated, the entries at the top would be Last and Last-1 from the table.

I'm having a mental block on coming up with a simple way to do this without using a portal. I could use a script to find the entries a populate a couple of global fields, but I'm hoping for simple, direct-display method that wouldn't require triggering such a script. Another complicating factor is that this layout references a separate data file that can't be added to at this time. Only my GUI file can be changed.

Any suggestions will be appreciated.

Why do you not want to use a portal? There are lots of things you can do with the *appearance* of a portal; such as set line width to zero, for instance.

I agree that a portal would be the way to go but if you don't have a global in your data file and if you also can't add a calculation in your data file (and you don't have vs. 11 to take advantage of filtered portals), then here is one kinda ugly way of accomplishing it.

Note that the UI holds everything needed. The yellow display field is from UI and I formatted it to show as one line (only the last two descriptions). I suppose it could be scripted as well but I personally feel that's what a UI file is for ... work-arounds and calculations without cluttering the data file. :wink2:

There are surely other methods also.

LastTwo.zip

  • Author

The LastLessOne TO is novel way to get at that record. Actually, I hadn't considered using Last() because its entry in the Specify Calculation table of function choices says "Last(RepeatingField)" and I thought it only applied to those. I had never bothered to read up on it.

I'm also glad you mentioned filtered portals. I'll be upgrading to FM11 soon and this now looks like an obvious first use.

Thanks for your help.

How about something in the same vein, just a little simpler? Though I cannot see the big difference between this and a portal - except the portal wouldn't need even that one calculation field.

Of course, you could make it really simple (and ugly) by going into list view and entering data in a trailing grand summary.

Last2.zip

Good example. But whether portal or not, seems to me that no changes to the data file are required.

Here's another approach, showing a no-lines portal, and also a script-populated global field.

Conditional highlighting also shows when the new description matches a recent description.

EventHistory.fp7.zip

seems to me that no changes to the data file are required.

There are no changes to the data file in LaRetta's example (or mine).

There are no changes to the data file in LaRetta's example (or mine).

Read this again:

http://fmforums.com/forum/showpost.php?post/365019/

"but if you don't have a global in your data file and if you also can't add a calculation in your data file..."

Edited by Guest

I have read it, and I have also looked at the file. There are no changes to the data file.

I have read it, and I have also looked at the file. There are no changes to the data file.

Correct.

What is your point?

LaRetta says basically, well, if you don't have a global in the data file; and you can't create a calc in the data file; then the next best, not quite as good choice is to do this.

I just didn't see any need to even consider modifying the data file in the first place.

I don't think you have made yourself clear until now.

Hi Michael,

Yes, that's simpler. I considered GetNthRecord() but thought it might be slower over very large data set. But I suppose no slower than Last(). :smile2:

Bruce,

I never said global was required; I thought K1200 thought it was required (or SOME modification was required in the data file).

LaRetta says basically, well, if you don't have a global in the data file; and you can't create a calc in the data file; then the next best, not quite as good choice is to do this.

If you are going to quote me, quote me ... don't put your interpreted words in my mouth. :tongue2:

You used a portal or script. I provided a different approach.

Edited by Guest

Perhaps you feel disrespected, and I am sorry if that is the case. But there is nothing inherently disrespectful in the use of paraphrasing, and nothing disrespectful intended by my particular wording. In any kind of communication conflict or confusion, paraphrasing is one of the first and best tools to use, and it worked quickly in this case, to everybody's benefit.

In any kind of communication conflict or confusion, paraphrasing is one of the first and best tools to use, and it worked quickly in this case, to everybody's benefit.

No. It is not. Particularly when the person misinterprets what was said. It is one thing to paraphrase back to the person, beginning with "so do I understand you to mean..." - it is another to misquote to others.

and it worked quickly in this case, to everybody's benefit.

Except the person you should have been 'paraphrasing' to. Nobody likes words put in their mouth.

Spectacular.

Put me on your Ignore - your Lead Wall - that would be perfect. Then I might be able to be on these forums without dealing with you. I shall do the same.

This prevents an error in the result when Count ( Data::ID ) = 1 :P

Let(

n = Count ( Data::ID ) ;

If ( n > 1 ; GetNthRecord ( Data::Description ; n - 1 ) & ¶ ) & GetNthRecord ( Data::Description ; n )

)

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.