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.

how to get last record from a field on a portal?

Featured Replies

how to get last record/field  from a portal and used or copy that data in to other layout?

for more clearer view!

last.jpg

If it is driven off the buttons on the portal row then FM knows what portal row it is.

Otherwise you can use something like Last() across the relationship.  But be careful about using constructs like that in calculated fields.  They tend to become performance hogs as the data grows.

  • Author

tried it from the other layout and its the way what i wanted to..but when i tried on this layout it didn't work.

  • Author

this is the code in this layout that will add new data when I click Add Bill.

Set Variable [$CustomerID;Value Transaction::CustomersID]
Go to Layout["Add_Billing"(Transaction);]
New Record/Request
Set Field[Transaction::CustomersId;$CustomerID]
Go to Field[Transaction::Month]

add bill.jpg

"it didn't work" doesn't tell us much so you have to be a lot more explicit about what you tried and what the result is and what you expected.  Otherwise we're just guessing.

Provided that the relationship for the portal is just driven off the single "customerID" predicate then your script will properly create a new related record that will show in the portal.  Can you confirm that this part is working?

If you want the field "PRV RDG" to be be filled on that new record, with the value from the last related record then you have to capture that value at the start of the script and then set it in the proper field after creating the new record.

  • Author

yes that what i really meant, I'm trying to set the "PRV RDG" from the last row of the portal from PRS RDG.before creating/add new record.how can i do that and where i could put the script in?

  • Author

yes sir, the part that creates a record is properly working.

  • Author

this is what i came up with, but when i tried it ,it only shows the "PRV" when i start to input data in a field,

script.jpg

Looks like we're having the same conversation in two different threads.

Your line #1 doesn't capture the PRV value from the last related record, it captures the value from the first related value (assuming that the layout is based on the "wb" table occurrence).

Change that first line to use Last( Transaction::PRV )

  • Author

Thanks for the response sir,i'll try this right away when i got back to office.

 

  • Author

thanks sir @Wim Decorte this is what i looking for, it solved my problem. thanks again sir.

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.