Use value of a field of a page, in the extension of a table

Hello everyone. I am a beginner in programming for central business, and I have the following need which I have not been able to solve.

I made an extension for a field of the table “Purchase Header” (1), to which I modified the functionality of the field that you see in point 2 (property “TableRelation”), the problem I am having is that the list of my lockup It must be filtered by a value from the “Purchase Invoice” page (3), I don’t know how I should take a value from the “Purchase Invoice” page, and use it in the extension I made to the table, can you help me?

Thanks in advance.