Linking two fields and forms

Linking two fields and forms

I have been trying to establish a relationship like the one in this example. I want to a record from a Look up field and fetch records from another Form and into these records into fields of the Same type and Name as the related Form.  i am using script with my form and app names that looks like this: 

string externalapps.GetType(int name)

{
    if (Enrollment_Information[ID == input.name].count()  >  0)
    {
        return Enrollment_Information[ID == input.name].Dog_s_Name_1;
    }
    return "";
}

i entered that code into the Create New Function area.
Then i entered:

input.Daily_Credits = paws-to-play.externalapps.GetType(input.Dogs_Attending); 

Into Dogs_Attending field>On User Input 
but it is telling me that GetType is not a Function.

So im COnfused....Help?