Jump to content
Server Maintenance This Week. ×

How to get first entry of filtered portal?


K1200

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

Recommended Posts

I use a filtered portal to display a subset of content from a table.  Everything works fine and when I click on a portal entry, I have no problem fetching the corresponding table entry ID and then displaying related content from the specific entry.  All that is good.

The problem is that I have a script that needs to get the ID for the first entry in the current results.  I've tried different ways, but none will return that first ID ... even though I "go to object" ... first the portal name and then the field name.  Usually the ID that's returned is the first for the table, as if the portal filter is being ignored.

I certainly don't want to build in a duplicate Find operation when the correct entry is right there on the screen!

How can my script get the entry?

Thanks in advance for any assistance.

 

Filtered.jpg

Link to comment
Share on other sites

43 minutes ago, K1200 said:

Usually the ID that's returned is the first for the table, as if the portal filter is being ignored.

If you are in a portal row, then the expression PortalTable::Field returns the value from the record in the active portal row. It doesn't matter if the portal is filtered or not.

Note that you do not need the ID in order to go to the related record - if that's what you're after.

Link to comment
Share on other sites

Thanks for your reply.  It led me to retrace my script steps for the Nth time.  As I mentioned, I was going to object (portal, by name, and then field) and then setting a parameter with the current ID.  As something to try, I inserted a Go to Portal Row[first] ... and voila!, it fetched the current first ID.

Apparently, going to object doesn't home in on any current content.  I never realized that.

Onward!

Link to comment
Share on other sites

7 hours ago, K1200 said:

I was going to object (portal, by name, and then field)

Probably not. Going to portal alone does not select a portal row - as you can see if you do:

Go to Object [ "yourPortalName" ]
Show Custom Dialog [ Get ( ActivePortalRowNumber ) ]

But if you do:

Go to Object [ "yourPortalName" ]
Go to Field [ PortalTable::FieldInPortal ]
Show Custom Dialog [ Get ( ActivePortalRowNumber ) ]

you will be in the first row of your portal.

 

Edited by comment
Link to comment
Share on other sites

This topic is 2890 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.