AnsweredAssumed Answered

How to reuse script's code in different contexts (relationship)

Question asked by jpbarna on Feb 3, 2018
Latest reply on Feb 3, 2018 by monkeybreadsoftware



I have a script that uses data from a row in a portal that I want to use without having to duplicate it but from different portals based on different relationships.


The script says something like "move playhead to Events:startTime" when I have a portal with Events row items in it. I've made another Relationship named Events 2 so, the script fails in that new context because the new portal has Events 2:startTime as needed field.


How could I reuse the code or make it flexible?


I was thinking about passing the name of the field as a parameter, but unsure. Are there any other ways to achieve this?


Thanks a lot for your help