Lookup returning wrong id

Hi,
I’m having a problem with a lookup call.
As I need to call the lookup in my code, can’t use button method, I need to set the returned id in a form variable.
The first time the lookup works without problems, but from that point on no matter wich record I select the returned id is the same.

I’m using framework 6 and a custom lookup form, with the same code as the default form obviously. :D

Thanks for the help

Cheers and Happy Holydays

Fixed.
Te problem was the JSEvent.
Te first time the event was fired from a custom form containing the variable.
The following events were fired from the navigation form delivered with the framework so the variable wasn’t going to be there.