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.

Creating a portal record script

Featured Replies

Hi...Please Help!

I am designing a database for out maintenance guys. I have a table called "Machines", this contains all the machines we have with serial details etc, I then have another table called "Service Info", these are linked with a primary key called MachineID. On my machines form layout is a portal that shows all the services for that particular machine. I want to create a script that adds a service file for that particular machine and copies over the last service date, how ever what I tried doesnt work because it take the last record within the whole of the service info table and uses that, in otherwords it copying another machines service date. This is the script.

 

Please Help!!!!

 

 

Script.JPG

table.JPG

Form.JPG

Assuming the portal on your MACHINE layout is sorted with the most recent service at the top, then you could set some another variable (before the 'New Window' step) to capture the last service date by doing something like :-

Go To Field ("Any field in your portal")

Go To Portal Row (First)

Set Variable ($lastServiceDate , <lastServiceFieldname>)

This should be simple and work fine. You could also use an execute SQL statement to get the most recent service date, replace the three lines above with something like :-

Set Variable ($lastServiceDate ,

ExecuteSQL ("

SELECT lastServiceDate

FROM ServiceInfo

WHERE MACHINE_ID = ?

ORDER BY lastServiceDate DESC

FETCH FIRST 1 ROW ONLY" ; "" ; "" ; Machines::MACHINE_ID)

)

 

Hope that helps

Edited by rwoods

  • Author

Thanks ever so much, I will give this a go tomorrow and let you know the outcome! Execute SQL looks daunting but I might give it a go!!!

Thanks rwoods

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.