Forum Discussion

Adagio's avatar
Adagio
Frequent Contributor
6 years ago

ReferenceError: recordToObject is not defined

Hello,

 

I'm using this code to fetch the DB Table data into an array, but just today I started getting this error:

"ReferenceError: recordToObject is not defined"

 

Could some one please help me understand what's the issue here?

 

//execute a query
var set = conn.Execute_(execQuery);
//declare an array 
var DBlist  = new Array();;

  if(set.EOF == false){
  set.MoveFirst();
  while(! set.EOF)
  {
    //Log.Message(set.Fields)
    DBlist.push(recordToObject(set));
    set.MoveNext();
  }
  Log.Message(DBlist.length);
  Log.Message(DBlist[0]);
  conn.Close();
  return DBlist;
  
  }else{
    Log.Message("No Records Found in the DB");
    //Closing the connection
    conn.Close(); 
    return false;
  }

 

Any help would be appreciated!

 

Thank you

Abhi

4 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    recordToObject sounds like something that I wrote as a utility and shared on here (can't find the original post).

     

    Perhaps you saw my example and assumed this was a built in utility to Test Complete?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What is "recordToObject"? It's a method/function call you're making but there's nothing in what you posted to tell us about it.

     

    Generally, the error you reported is that the JavaScript engine is trying to find the function to execute but can't because, for some reason, it's not in scope for what you have referenced.

     

    Is it a function in a different script unit? Is it a function in the same script unit? Where is it defined and how?