Retrieve Customer Number from another company code

Hello All,

I'm trying to create a script that would look up the current customer by name in another company code and insert the corresponding customer number into a UDF.  Is there code that could be used to run lines of a user defined script on another company code?

Thanks in advance!