Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7444 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

...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

This topic is 7444 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.