April 12, 201510 yr I have a layout that performs a script OnRecordCommit. The script includes a sort. How can I "mark" the record and then, after the OnRecordCommit script finishes, return to the same record? Thanks, Kevin
April 12, 201510 yr IMHO, a better solution would defer the sort (perhaps even the commit) until after the user is done with the record - so it wouldn't be necessary to return to it. In what type of view is the layout you're in when doing this?
April 13, 201510 yr comment has a better answer if you don't need to commit, but if you do... You can go simple and dirty or you can go complex and clean. Simple: Grab the record's unique primary key then loop through your newly sorted found set until you get to the right record. Complex (helpful if you have a huge number of records, or if they are "wide" or if performance is really important): Created a summary List of the primary keys. Grab the primary key of your record, then sort. Grab the Summary list of and find your primary key in that list using a custom function like ValuePosition(). Use that number to Go to Record[]...
April 13, 201510 yr Created a summary List of the primary keys. OP's profile shows version 11. Incidentally, I am quite sure this was visible on the side bar when I posted my answer, but it's not visible now.
Create an account or sign in to comment