AnsweredAssumed Answered

Go to record, request, page

Question asked by Cécile on Feb 17, 2019
Latest reply on Feb 18, 2019 by beverly

(Question at the bottom)

I can't believe I've been using this script step for 3 years now and for some reason, I don't recall ever noticing the following. Perhaps because it is a situation that occurs specifically when duplicating a record by script... which I only did once copying someone else's code....


My products are sorted alphabetically. So I am duplicating a product and its related records. In the process, I have loaded the record number of the original product into the variable $recNum and the new product UUID into a variable $ProdUUID.


Once all is done, all there is to do is to go back to my original layout and to the newly created product. To make sure I display the right record, I use the script step:


Go to Record/Request/Page [With dialog:Off; $ProdUUID]


To my dismay, I land on the first record of the 390, which is not the product I duplicated. I scroll to the end, last created... probably last? Nope. Since my records are sorted alphabetically, I found the original, followed by its copy, in the alphabetical sequence.


It (finally!) occured to me to use the record number instead of the product id...

Go to Record/Request/Page [With dialog:Off; $recNbr+l]


This time I do land on the correct product (the copy). HOWEVER, this is good as long as my records are sorted in alphabetical order. If they aren't, the copy will not necessarily follow the original.


->What would be the best way to insure I land on the right record (without messing with the sorting, which could irate a user)?