Dr. Evil Posted June 28, 2009 Posted June 28, 2009 How can I direct my creation script to portal's most recently created record? In my database I have chosen to not allow user to create a portal record via click in next empty row. I have a separate "creation table" that is not on the user interface. So I have a script that does the creation for user. Currently the script will create record > then go to last portal row. The problem is, on most of my portals I have an alphabetical sort for ease of reading. So (go to last portal) will not necessary be the newly created record. I can make this work if I sort portal by modification timestamp, but then I lose my alphabetical sort which is a bad thing. NOTE: Some portals may not be sorted alphabetical, some by price, rating, etc. So I'm thinking the solution is to point the creation script to latest modified portal record, but I do not know hot to do this. Any help on this of course is greatly appreciated. Thank you so much for your time!
comment Posted June 28, 2009 Posted June 28, 2009 Interesting problem. A couple of ways come to mind: 1. After creating the new record, set a variable to its serial ID. Back in the parent record, loop through the portal rows until the variable equals Child::ChildID. 2. Start the script by GTRR [show related only]*. Create the new record, sort the records alphabetically, and set a variable to Get (RecordNumber) - this will be the row number to go to back in the parent record. 3. Sort the relationship alphabetically, instead of (or in addition to) just the portal. After creating the new record, set a variable to its serial ID. Back in the parent record, look for the position of the ID in List ( Child::ChildID ) and calculate the portal row to go to. --- (*) Actually, it needs to start by checking for the existence of related records. If none has been created yet, go and create one - then go to the first portal row.
Recommended Posts
This topic is 5627 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 accountSign in
Already have an account? Sign in here.
Sign In Now