January 18, 201016 yr We are in need a script that will take the operator to the next related record. The found set cannot be constrained to related records only, so in the stack of records there are related records and unrelated records. Some how we need to set up a 'next' button that will take the operator to the next related record, skipping over the unrelated records that might be in between. Any suggestions? Thanks in adavance.
January 18, 201016 yr Author There are vendor records stored in a vendor table. There are related product records in a product table. On a layout displaying individual product records (layout is based on the product table) we need a button will take the operator to the next product record of the same vendor as the current product record.
January 18, 201016 yr Why can't the found set be constrained to the products of the specific vendor? Also, is this really for version 7? Edited January 18, 201016 yr by Guest
January 18, 201016 yr Author No...sorry. Its v 10. I suppose it technically could be constrained, but the system was built by another developer that didn't really abstract the navigation logic. There are lots of points from which an operator could navigate to the product screen. The system is in active use. It feels like constraining the found set leaves a lot more room for breakage of the existing work. It seems to be that using value lists it should be possible to get the current record id somehow and from there get the next related record id and use that to navigate to that record. I can't seem to figure it out though.
January 18, 201016 yr In version 10 you could trigger a script that would constrain the found set on layout load (assuming you ALWAYS want it so). Or you could store the VendorID in a variable and go to next record in a loop until it matches (or go back to the original record if you've reached the end of the found set). I can't say I like either method, though - both are merely a patch over the real issue.
January 18, 201016 yr Author Those are both great suggestions. I agree with you that they are sort of patch for a larger problem. Right now its hard to sell something to a client that doesn't show result. An under-the-hood fix to a larger problem is just hard to get by for these folks. Thanks for the ideas. I'll play with them a bit.
January 19, 201016 yr Or use a variation on Comment's technique, using getNthRecord and incrementing N starting with get(RecordNumber) until you get to the next value where vendor ID = vendor ID of the current record. Or don't do any navigation at all - use conditional formatting. Use an on record load script to set $$vendorID to current vendor ID. Use conditional formatting to highlight records with VendorID = $$vendorID. The user can then see which are the same-vendor records. Always use a Freeze statement before setting the variable.
Create an account or sign in to comment