Link to home
Start Free TrialLog in
Avatar of Will Loving
Will LovingFlag for United States of America

asked on

Determining a field's repetition when clicking on it

I have a calculated repeating field which has a button/script attached to it. When the user clicks on it, I want to determine which repetition is being clicked on to inform the scripted action that follows. Nothing I've tried so far has worked. Get( ActiveRepetitionNumber ) produces only a zero because the cursor never enters the field and it's not possible to give an Object Name to each repetition of a field.

( Why am I using repeating fields at all? They have their uses, especially if you want the visual equivalent of a horizontal portal, which you can do using a calculated repeating field.)
Avatar of Will Loving
Will Loving
Flag of United States of America image

ASKER

Never mind. I sort of wrote the key to the answer in my initial question when I wrote "because the cursor never enters the field". The trick is to allow the cursor to enter the field and then use an "On Enter" Script Trigger to grab the Repetition number using SetVariable to Get( ActiveRepetitionNumber ) ; followed by a Commit Records step to exit the field and then run the rest of the script.
Hi willmcn,

I think you could have separate buttons over the repetitions and pass a parameter to the script depending on which buttons is clicked.
It would work, but unfortunately that would mean 18 buttons. I just tested my script trigger solution which took at two minutes to setup and it works perfectly. Being in the field also allows to grab other related values at the same time before exiting. As far as the user is concerned, they never now the difference.
ASKER CERTIFIED SOLUTION
Avatar of Will Loving
Will Loving
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.