Jump to content
Server Maintenance This Week. ×

Go To Record Script


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

Recommended Posts

I know this should be simple but I can not seem to get it. I have DB of customers and a portal that displays related jobs. In the jobs DB I have an auto number field set up. From the customers DB I have a button that takes me to the related record in the jobs DB. I would like to go to the related record from the customers to the Jobs DB and go to the most recently created record, yet showing all records. Any suggestions?

Link to comment
Share on other sites

Put the button in the portal and GTRR will take you to that record. Not sure what you mean by showing all records. Do you want all records for the customer or all records in the table? If the first use the Show option. You will have to add a script step to take you to the last record.

Link to comment
Share on other sites

You don't even need the button in the row, if I understand your request. The button can be above the portal, because all records in the portal are related to that specific customer.

A script of:

Go To Related Records { do not click 'Show Only Related' ]

Go To Record/Request/Page [ Last ]

This will provide the related set to that customer and place you on the last related record created. Your most recently created jobs record will always be your last - if it is unsorted.

LaRetta wink.gif

Link to comment
Share on other sites

I used your script but for some reason, even though I have Last set on the GTR, I am still ending up at the first record created in the found set. I do thank every one for your help.

Just to clarify my goal is to go to the most recent related record but still show entire table or all records.

Nick

Link to comment
Share on other sites

If I understand you correctly (and that's a big IF), you want (a) to see all the records in the JOBS table, whether related to this Customer or not, and (:P to land on the most recent record for this Customer.

Try this:

In the definition of the relationship, click "Sort records" and create a sort order by Date, descending (or Record ID, descending - whatever it takes to make the most recent record to be the first one in the sort order).

You can to set a different sort order for the portal, if you like.

Now the script is simply:

Go To Related Record [ ] // do NOT check 'Show only related records'

Put the button anywhere OUTSIDE the portal.

BTW, with a one-liner like this you don't even need a script - you can do this directly in the button definition.

Link to comment
Share on other sites

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