Behavior of OnRecordLoad script trigger
What I'm trying to do is setting up a global variable that shows the current record number. What I thought would work is writing a script like this:
Set Variable [$$R; Value:Get (RecordNumber)]
and attach it to a OnRecordLoad script trigger.
Since OnRecordLoad is a post-event script trigger, it should be triggered after the new record I switch to has become my current record. So I thought the global variable '$$R' will always show the current record number. However, instead of getting the current record number, I got the record number of the record that I switched from, which is the last record that I was looking at.
Could anyone please tell me why is this happening? and how to fix it?