Problem with Many to Many lookups if using variable not in original table

Hi
I have a many to many field in a form that needs to use a global variable for the update and lookups.

  1. There is no place in the relationships keys to add a global variable (Only a field)
  2. If you create either a temporary field, or populate an existing tabel field in the onLoad event, the rest of the form works fine and displays the field as expected… BUT the updated field does NOT get passed through the keys in the lookup.

Keys setup in many to many:

Has anyone solved this issue?

Edit1: If I manually hack the right project reference into the original table in the TempProj field, then everything works as expected, but this is not a solution to my problem!

Edit2: I’ve hacked an UGLY solution by updating the TempProj field in the database in the onScriptinit event with the relevant global variable so that the lookup field always has the global variable in it, BUT this just seems an absurd way to deal with this.