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.

Featured Replies

Okay what I basically want to do is be able to assign 1 row in a portal a different colour and make it stay at the top of all the other portal entries?

Does anyone know how this is possible?

Thanks

Yep. It is possible.

1. If you don't already have one create a uniqueID field in the related file.

2. Create a global number field in the main file called gSortFirst in which to store the ID of the record you want to appear at the top of the portal.

3. Create a global container field in the related file called gSwatch and place a 1px x 1px rectangle of a bright color in it.

4. Create a calc in the related file called cSwatch with a result of container and the formula:

Case(uniqueID = MainFile::gSortFirst, gSwatch)

5. Create another calc in the related file called cSortFirst with a result type of number and with the formula:

2 - (uniqueID = MainFile::gSortFirst)

6. Place the RelatedFile::cSwatch field in the background of the portal row, size it to fill the row and set the graphic format options to enlarge and turn off the option to maintain proportions.

7. Create a script with the command Set Field ["gSortFirst", "RelatedFile::uniqueID"] and attach it to a button in the portal.

8. Set up the relationship on which the portal is based to sort ascending by the cSortFirst field (other sort criteria if any should be placed below this field in the sort specification)

That's it. When you run the script and refresh the portal, the current portal row will move to the top, change color and stay there until/unless you run the script on a different row.

  • Author

This seems simple but I'm definitely missing something silly in they way I want it?

See attached

Thanks

How.zip

...I'm definitely missing something...

OK, I've had a quick look at your files.

They were working, but it was not obvious because the portal was not refreshing immediately to reflect the change. If you want it to appear instantaneous (without having to manually force the portal to refresh) then you simply need to add a portal refresh script and call it as a sub-script of the 'set' script.

I've updated your file with a portal refresh script example (see attached).

HowTo.zip

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.