Script for lookup of data across different applications

Script for lookup of data across different applications

I would like to do a lookup from a separate application. Here is an example:

config-module: 

"Form1" has fields: Global Category, Prefix 

hr-module:

"Form2" has fields: Category and Name

--> Category is my lookup field. 

--> When I lookup a category, I would like to populate from config-module's field Global Category. 

The issue is, I want to create a function to get the details from the form programatically, it keeps suggesting that there is an error...the problem is that my lookup field (which is of type = string) is now type = long. I know that this is referring to the ID (which is not helpful).

I know I can simply overcome this problem by creating another form with Category in the hr-module, but that is not what I would like to do, since this field is to be shared with other applications as well (hence the name, Global Category!)

So what would a script to do create a lookup look like?

Admittedly, I'm a noob...the code below does NOT work but this is what I can work out based on reading (and getting confused) the forums...

On user input, this is my code:

Category = config-module.externalapps.Form1[ID = row.Global_Category];

What am I doing wrong?? 

Thanks in advance...